From c3e69a84781205d4b7df312ddc1b84508e479de4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Feb 2022 05:56:02 +0000 Subject: [PATCH] CodeGen from PR 17640 in Azure/azure-rest-api-specs Merge 35ff8e7a94f12620d331bdfdbe5f10b53f9bf049 into abb41537b416b30bfe9fca6df98ad0fc64cfb1d7 --- .../azure-mgmt-containerservice/_meta.json | 10 +- .../mgmt/containerservice/_configuration.py | 4 +- .../_container_service_client.py | 33 +- .../containerservice/aio/_configuration.py | 4 +- .../aio/_container_service_client.py | 34 +- .../containerservice/v2017_07_01/__init__.py | 9 +- .../v2017_07_01/_configuration.py | 19 +- .../v2017_07_01/_container_service_client.py | 84 +- .../v2017_07_01/_metadata.json | 21 +- .../containerservice/v2017_07_01/_patch.py | 31 + .../containerservice/v2017_07_01/_vendor.py | 27 + .../v2017_07_01/aio/__init__.py | 5 + .../v2017_07_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 72 +- .../v2017_07_01/aio/_patch.py | 31 + .../_container_services_operations.py | 290 +- .../v2017_07_01/models/__init__.py | 57 +- .../models/_container_service_client_enums.py | 29 +- .../v2017_07_01/models/_models.py | 804 --- .../v2017_07_01/models/_models_py3.py | 500 +- .../_container_services_operations.py | 581 +- .../containerservice/v2018_03_31/__init__.py | 9 +- .../v2018_03_31/_configuration.py | 19 +- .../v2018_03_31/_container_service_client.py | 88 +- .../v2018_03_31/_metadata.json | 21 +- .../containerservice/v2018_03_31/_patch.py | 31 + .../containerservice/v2018_03_31/_vendor.py | 27 + .../v2018_03_31/aio/__init__.py | 5 + .../v2018_03_31/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 76 +- .../v2018_03_31/aio/_patch.py | 31 + .../_managed_clusters_operations.py | 578 +- .../v2018_03_31/aio/operations/_operations.py | 45 +- .../v2018_03_31/models/__init__.py | 75 +- .../models/_container_service_client_enums.py | 31 +- .../v2018_03_31/models/_models.py | 1023 --- .../v2018_03_31/models/_models_py3.py | 549 +- .../_managed_clusters_operations.py | 1197 ++-- .../v2018_03_31/operations/_operations.py | 86 +- .../v2018_08_01_preview/__init__.py | 9 +- .../v2018_08_01_preview/_configuration.py | 19 +- .../_container_service_client.py | 88 +- .../v2018_08_01_preview/_metadata.json | 21 +- .../v2018_08_01_preview/_patch.py | 31 + .../v2018_08_01_preview/_vendor.py | 27 + .../v2018_08_01_preview/aio/__init__.py | 5 + .../v2018_08_01_preview/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 76 +- .../v2018_08_01_preview/aio/_patch.py | 31 + .../_managed_clusters_operations.py | 585 +- .../aio/operations/_operations.py | 45 +- .../v2018_08_01_preview/models/__init__.py | 78 +- .../models/_container_service_client_enums.py | 33 +- .../v2018_08_01_preview/models/_models.py | 1069 --- .../v2018_08_01_preview/models/_models_py3.py | 607 +- .../_managed_clusters_operations.py | 1208 ++-- .../operations/_operations.py | 86 +- .../v2018_09_30_preview/__init__.py | 9 +- .../v2018_09_30_preview/_configuration.py | 19 +- .../_container_service_client.py | 84 +- .../v2018_09_30_preview/_metadata.json | 21 +- .../v2018_09_30_preview/_patch.py | 31 + .../v2018_09_30_preview/_vendor.py | 27 + .../v2018_09_30_preview/aio/__init__.py | 5 + .../v2018_09_30_preview/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 72 +- .../v2018_09_30_preview/aio/_patch.py | 31 + ..._open_shift_managed_clusters_operations.py | 334 +- .../v2018_09_30_preview/models/__init__.py | 45 +- .../models/_container_service_client_enums.py | 25 +- .../v2018_09_30_preview/models/_models.py | 542 -- .../v2018_09_30_preview/models/_models_py3.py | 343 +- ..._open_shift_managed_clusters_operations.py | 651 +- .../containerservice/v2019_02_01/__init__.py | 9 +- .../v2019_02_01/_configuration.py | 19 +- .../v2019_02_01/_container_service_client.py | 92 +- .../v2019_02_01/_metadata.json | 21 +- .../containerservice/v2019_02_01/_patch.py | 31 + .../containerservice/v2019_02_01/_vendor.py | 27 + .../v2019_02_01/aio/__init__.py | 5 + .../v2019_02_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2019_02_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 221 +- .../_managed_clusters_operations.py | 584 +- .../v2019_02_01/aio/operations/_operations.py | 45 +- .../v2019_02_01/models/__init__.py | 90 +- .../models/_container_service_client_enums.py | 33 +- .../v2019_02_01/models/_models.py | 1404 ---- .../v2019_02_01/models/_models_py3.py | 893 ++- .../operations/_agent_pools_operations.py | 453 +- .../_managed_clusters_operations.py | 1213 ++-- .../v2019_02_01/operations/_operations.py | 86 +- .../containerservice/v2019_04_01/__init__.py | 9 +- .../v2019_04_01/_configuration.py | 19 +- .../v2019_04_01/_container_service_client.py | 92 +- .../v2019_04_01/_metadata.json | 21 +- .../containerservice/v2019_04_01/_patch.py | 31 + .../containerservice/v2019_04_01/_vendor.py | 27 + .../v2019_04_01/aio/__init__.py | 5 + .../v2019_04_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2019_04_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 221 +- .../_managed_clusters_operations.py | 584 +- .../v2019_04_01/aio/operations/_operations.py | 45 +- .../v2019_04_01/models/__init__.py | 93 +- .../models/_container_service_client_enums.py | 37 +- .../v2019_04_01/models/_models.py | 1466 ---- .../v2019_04_01/models/_models_py3.py | 946 ++- .../operations/_agent_pools_operations.py | 453 +- .../_managed_clusters_operations.py | 1213 ++-- .../v2019_04_01/operations/_operations.py | 86 +- .../containerservice/v2019_04_30/__init__.py | 9 +- .../v2019_04_30/_configuration.py | 19 +- .../v2019_04_30/_container_service_client.py | 84 +- .../v2019_04_30/_metadata.json | 21 +- .../containerservice/v2019_04_30/_patch.py | 31 + .../containerservice/v2019_04_30/_vendor.py | 27 + .../v2019_04_30/aio/__init__.py | 5 + .../v2019_04_30/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 72 +- .../v2019_04_30/aio/_patch.py | 31 + ..._open_shift_managed_clusters_operations.py | 331 +- .../v2019_04_30/models/__init__.py | 45 +- .../models/_container_service_client_enums.py | 25 +- .../v2019_04_30/models/_models.py | 553 -- .../v2019_04_30/models/_models_py3.py | 327 +- ..._open_shift_managed_clusters_operations.py | 648 +- .../containerservice/v2019_06_01/__init__.py | 9 +- .../v2019_06_01/_configuration.py | 19 +- .../v2019_06_01/_container_service_client.py | 92 +- .../v2019_06_01/_metadata.json | 21 +- .../containerservice/v2019_06_01/_patch.py | 31 + .../containerservice/v2019_06_01/_vendor.py | 27 + .../v2019_06_01/aio/__init__.py | 5 + .../v2019_06_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2019_06_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 584 +- .../v2019_06_01/aio/operations/_operations.py | 45 +- .../v2019_06_01/models/__init__.py | 105 +- .../models/_container_service_client_enums.py | 41 +- .../v2019_06_01/models/_models.py | 1667 ----- .../v2019_06_01/models/_models_py3.py | 1100 ++- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1213 ++-- .../v2019_06_01/operations/_operations.py | 86 +- .../containerservice/v2019_08_01/__init__.py | 9 +- .../v2019_08_01/_configuration.py | 19 +- .../v2019_08_01/_container_service_client.py | 92 +- .../v2019_08_01/_metadata.json | 21 +- .../containerservice/v2019_08_01/_patch.py | 31 + .../containerservice/v2019_08_01/_vendor.py | 27 + .../v2019_08_01/aio/__init__.py | 5 + .../v2019_08_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2019_08_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 636 +- .../v2019_08_01/aio/operations/_operations.py | 45 +- .../v2019_08_01/models/__init__.py | 123 +- .../models/_container_service_client_enums.py | 41 +- .../v2019_08_01/models/_models.py | 1814 ----- .../v2019_08_01/models/_models_py3.py | 1187 +++- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1318 ++-- .../v2019_08_01/operations/_operations.py | 86 +- .../v2019_09_30_preview/__init__.py | 9 +- .../v2019_09_30_preview/_configuration.py | 19 +- .../_container_service_client.py | 84 +- .../v2019_09_30_preview/_metadata.json | 21 +- .../v2019_09_30_preview/_patch.py | 31 + .../v2019_09_30_preview/_vendor.py | 27 + .../v2019_09_30_preview/aio/__init__.py | 5 + .../v2019_09_30_preview/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 72 +- .../v2019_09_30_preview/aio/_patch.py | 31 + ..._open_shift_managed_clusters_operations.py | 334 +- .../v2019_09_30_preview/models/__init__.py | 48 +- .../models/_container_service_client_enums.py | 25 +- .../v2019_09_30_preview/models/_models.py | 583 -- .../v2019_09_30_preview/models/_models_py3.py | 355 +- ..._open_shift_managed_clusters_operations.py | 651 +- .../containerservice/v2019_10_01/__init__.py | 9 +- .../v2019_10_01/_configuration.py | 19 +- .../v2019_10_01/_container_service_client.py | 92 +- .../v2019_10_01/_metadata.json | 21 +- .../containerservice/v2019_10_01/_patch.py | 31 + .../containerservice/v2019_10_01/_vendor.py | 27 + .../v2019_10_01/aio/__init__.py | 5 + .../v2019_10_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2019_10_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2019_10_01/aio/operations/_operations.py | 45 +- .../v2019_10_01/models/__init__.py | 123 +- .../models/_container_service_client_enums.py | 41 +- .../v2019_10_01/models/_models.py | 1819 ----- .../v2019_10_01/models/_models_py3.py | 1187 +++- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2019_10_01/operations/_operations.py | 86 +- .../v2019_10_27_preview/__init__.py | 9 +- .../v2019_10_27_preview/_configuration.py | 19 +- .../_container_service_client.py | 84 +- .../v2019_10_27_preview/_metadata.json | 21 +- .../v2019_10_27_preview/_patch.py | 31 + .../v2019_10_27_preview/_vendor.py | 27 + .../v2019_10_27_preview/aio/__init__.py | 5 + .../v2019_10_27_preview/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 72 +- .../v2019_10_27_preview/aio/_patch.py | 31 + ..._open_shift_managed_clusters_operations.py | 334 +- .../v2019_10_27_preview/models/__init__.py | 51 +- .../models/_container_service_client_enums.py | 25 +- .../v2019_10_27_preview/models/_models.py | 602 -- .../v2019_10_27_preview/models/_models_py3.py | 363 +- ..._open_shift_managed_clusters_operations.py | 651 +- .../containerservice/v2019_11_01/__init__.py | 9 +- .../v2019_11_01/_configuration.py | 19 +- .../v2019_11_01/_container_service_client.py | 92 +- .../v2019_11_01/_metadata.json | 21 +- .../containerservice/v2019_11_01/_patch.py | 31 + .../containerservice/v2019_11_01/_vendor.py | 27 + .../v2019_11_01/aio/__init__.py | 5 + .../v2019_11_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2019_11_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2019_11_01/aio/operations/_operations.py | 45 +- .../v2019_11_01/models/__init__.py | 132 +- .../models/_container_service_client_enums.py | 43 +- .../v2019_11_01/models/_models.py | 1953 ------ .../v2019_11_01/models/_models_py3.py | 1315 +++- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2019_11_01/operations/_operations.py | 86 +- .../containerservice/v2020_01_01/__init__.py | 9 +- .../v2020_01_01/_configuration.py | 19 +- .../v2020_01_01/_container_service_client.py | 92 +- .../v2020_01_01/_metadata.json | 21 +- .../containerservice/v2020_01_01/_patch.py | 31 + .../containerservice/v2020_01_01/_vendor.py | 27 + .../v2020_01_01/aio/__init__.py | 5 + .../v2020_01_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2020_01_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2020_01_01/aio/operations/_operations.py | 45 +- .../v2020_01_01/models/__init__.py | 132 +- .../models/_container_service_client_enums.py | 43 +- .../v2020_01_01/models/_models.py | 1958 ------ .../v2020_01_01/models/_models_py3.py | 1322 +++- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2020_01_01/operations/_operations.py | 86 +- .../containerservice/v2020_02_01/__init__.py | 9 +- .../v2020_02_01/_configuration.py | 19 +- .../v2020_02_01/_container_service_client.py | 92 +- .../v2020_02_01/_metadata.json | 21 +- .../containerservice/v2020_02_01/_patch.py | 31 + .../containerservice/v2020_02_01/_vendor.py | 27 + .../v2020_02_01/aio/__init__.py | 5 + .../v2020_02_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2020_02_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2020_02_01/aio/operations/_operations.py | 45 +- .../v2020_02_01/models/__init__.py | 135 +- .../models/_container_service_client_enums.py | 45 +- .../v2020_02_01/models/_models.py | 2032 ------ .../v2020_02_01/models/_models_py3.py | 1412 +++- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2020_02_01/operations/_operations.py | 86 +- .../containerservice/v2020_03_01/__init__.py | 9 +- .../v2020_03_01/_configuration.py | 19 +- .../v2020_03_01/_container_service_client.py | 92 +- .../v2020_03_01/_metadata.json | 21 +- .../containerservice/v2020_03_01/_patch.py | 31 + .../containerservice/v2020_03_01/_vendor.py | 27 + .../v2020_03_01/aio/__init__.py | 5 + .../v2020_03_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2020_03_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2020_03_01/aio/operations/_operations.py | 45 +- .../v2020_03_01/models/__init__.py | 141 +- .../models/_container_service_client_enums.py | 51 +- .../v2020_03_01/models/_models.py | 2209 ------ .../v2020_03_01/models/_models_py3.py | 1595 +++-- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2020_03_01/operations/_operations.py | 86 +- .../containerservice/v2020_04_01/__init__.py | 9 +- .../v2020_04_01/_configuration.py | 19 +- .../v2020_04_01/_container_service_client.py | 92 +- .../v2020_04_01/_metadata.json | 21 +- .../containerservice/v2020_04_01/_patch.py | 31 + .../containerservice/v2020_04_01/_vendor.py | 27 + .../v2020_04_01/aio/__init__.py | 5 + .../v2020_04_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 83 +- .../v2020_04_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2020_04_01/aio/operations/_operations.py | 45 +- .../v2020_04_01/models/__init__.py | 144 +- .../models/_container_service_client_enums.py | 51 +- .../v2020_04_01/models/_models.py | 2259 ------- .../v2020_04_01/models/_models_py3.py | 1650 +++-- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2020_04_01/operations/_operations.py | 86 +- .../containerservice/v2020_06_01/__init__.py | 9 +- .../v2020_06_01/_configuration.py | 19 +- .../v2020_06_01/_container_service_client.py | 101 +- .../v2020_06_01/_metadata.json | 21 +- .../containerservice/v2020_06_01/_patch.py | 31 + .../containerservice/v2020_06_01/_vendor.py | 27 + .../v2020_06_01/aio/__init__.py | 5 + .../v2020_06_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 90 +- .../v2020_06_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 285 +- .../_managed_clusters_operations.py | 667 +- .../v2020_06_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../v2020_06_01/models/__init__.py | 159 +- .../models/_container_service_client_enums.py | 55 +- .../v2020_06_01/models/_models.py | 2427 ------- .../v2020_06_01/models/_models_py3.py | 1736 +++-- .../operations/_agent_pools_operations.py | 609 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2020_06_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../containerservice/v2020_07_01/__init__.py | 9 +- .../v2020_07_01/_configuration.py | 19 +- .../v2020_07_01/_container_service_client.py | 101 +- .../v2020_07_01/_metadata.json | 21 +- .../containerservice/v2020_07_01/_patch.py | 31 + .../containerservice/v2020_07_01/_vendor.py | 27 + .../v2020_07_01/aio/__init__.py | 5 + .../v2020_07_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 90 +- .../v2020_07_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_managed_clusters_operations.py | 667 +- .../v2020_07_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../v2020_07_01/models/__init__.py | 159 +- .../models/_container_service_client_enums.py | 57 +- .../v2020_07_01/models/_models.py | 2435 ------- .../v2020_07_01/models/_models_py3.py | 1725 +++-- .../operations/_agent_pools_operations.py | 731 +- .../_managed_clusters_operations.py | 1393 ++-- .../v2020_07_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../containerservice/v2020_09_01/__init__.py | 9 +- .../v2020_09_01/_configuration.py | 19 +- .../v2020_09_01/_container_service_client.py | 115 +- .../v2020_09_01/_metadata.json | 21 +- .../containerservice/v2020_09_01/_patch.py | 31 + .../containerservice/v2020_09_01/_vendor.py | 27 + .../v2020_09_01/aio/__init__.py | 5 + .../v2020_09_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 106 +- .../v2020_09_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_managed_clusters_operations.py | 771 +-- .../v2020_09_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2020_09_01/models/__init__.py | 168 +- .../models/_container_service_client_enums.py | 63 +- .../v2020_09_01/models/_models.py | 2589 ------- .../v2020_09_01/models/_models_py3.py | 1840 +++-- .../operations/_agent_pools_operations.py | 731 +- .../_managed_clusters_operations.py | 1603 +++-- .../v2020_09_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2020_11_01/__init__.py | 9 +- .../v2020_11_01/_configuration.py | 19 +- .../v2020_11_01/_container_service_client.py | 115 +- .../v2020_11_01/_metadata.json | 21 +- .../containerservice/v2020_11_01/_patch.py | 31 + .../containerservice/v2020_11_01/_vendor.py | 27 + .../v2020_11_01/aio/__init__.py | 5 + .../v2020_11_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 106 +- .../v2020_11_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_managed_clusters_operations.py | 771 +-- .../v2020_11_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2020_11_01/models/__init__.py | 195 +- .../models/_container_service_client_enums.py | 67 +- .../v2020_11_01/models/_models.py | 3037 --------- .../v2020_11_01/models/_models_py3.py | 2279 +++++-- .../operations/_agent_pools_operations.py | 731 +- .../_managed_clusters_operations.py | 1603 +++-- .../v2020_11_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2020_12_01/__init__.py | 9 +- .../v2020_12_01/_configuration.py | 19 +- .../v2020_12_01/_container_service_client.py | 122 +- .../v2020_12_01/_metadata.json | 21 +- .../containerservice/v2020_12_01/_patch.py | 31 + .../containerservice/v2020_12_01/_vendor.py | 27 + .../v2020_12_01/aio/__init__.py | 5 + .../v2020_12_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 113 +- .../v2020_12_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 771 +-- .../v2020_12_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2020_12_01/models/__init__.py | 210 +- .../models/_container_service_client_enums.py | 73 +- .../v2020_12_01/models/_models.py | 3251 --------- .../v2020_12_01/models/_models_py3.py | 2449 +++++-- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 1603 +++-- .../v2020_12_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2021_02_01/__init__.py | 9 +- .../v2021_02_01/_configuration.py | 19 +- .../v2021_02_01/_container_service_client.py | 122 +- .../v2021_02_01/_metadata.json | 21 +- .../containerservice/v2021_02_01/_patch.py | 31 + .../containerservice/v2021_02_01/_vendor.py | 27 + .../v2021_02_01/aio/__init__.py | 5 + .../v2021_02_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 113 +- .../v2021_02_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 771 +-- .../v2021_02_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2021_02_01/models/__init__.py | 210 +- .../models/_container_service_client_enums.py | 73 +- .../v2021_02_01/models/_models.py | 3290 --------- .../v2021_02_01/models/_models_py3.py | 2497 +++++-- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 1603 +++-- .../v2021_02_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2021_03_01/__init__.py | 9 +- .../v2021_03_01/_configuration.py | 19 +- .../v2021_03_01/_container_service_client.py | 122 +- .../v2021_03_01/_metadata.json | 21 +- .../containerservice/v2021_03_01/_patch.py | 31 + .../containerservice/v2021_03_01/_vendor.py | 27 + .../v2021_03_01/aio/__init__.py | 5 + .../v2021_03_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 113 +- .../v2021_03_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 907 ++- .../v2021_03_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2021_03_01/models/__init__.py | 228 +- .../models/_container_service_client_enums.py | 79 +- .../v2021_03_01/models/_models.py | 3482 ---------- .../v2021_03_01/models/_models_py3.py | 2599 +++++-- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 1899 ++++-- .../v2021_03_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2021_05_01/__init__.py | 9 +- .../v2021_05_01/_configuration.py | 19 +- .../v2021_05_01/_container_service_client.py | 122 +- .../v2021_05_01/_metadata.json | 21 +- .../containerservice/v2021_05_01/_patch.py | 31 + .../containerservice/v2021_05_01/_vendor.py | 27 + .../v2021_05_01/aio/__init__.py | 5 + .../v2021_05_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 113 +- .../v2021_05_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 972 ++- .../v2021_05_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2021_05_01/models/__init__.py | 243 +- .../models/_container_service_client_enums.py | 79 +- .../v2021_05_01/models/_models.py | 3750 ----------- .../v2021_05_01/models/_models_py3.py | 2835 +++++--- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 2026 ++++-- .../v2021_05_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2021_07_01/__init__.py | 9 +- .../v2021_07_01/_configuration.py | 19 +- .../v2021_07_01/_container_service_client.py | 122 +- .../v2021_07_01/_metadata.json | 21 +- .../containerservice/v2021_07_01/_patch.py | 31 + .../containerservice/v2021_07_01/_vendor.py | 27 + .../v2021_07_01/aio/__init__.py | 5 + .../v2021_07_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 113 +- .../v2021_07_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 972 ++- .../v2021_07_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../v2021_07_01/models/__init__.py | 249 +- .../models/_container_service_client_enums.py | 81 +- .../v2021_07_01/models/_models.py | 3678 ---------- .../v2021_07_01/models/_models_py3.py | 2747 ++++++-- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 2026 ++++-- .../v2021_07_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../containerservice/v2021_08_01/__init__.py | 9 +- .../v2021_08_01/_configuration.py | 19 +- .../v2021_08_01/_container_service_client.py | 126 +- .../v2021_08_01/_metadata.json | 21 +- .../containerservice/v2021_08_01/_patch.py | 31 + .../containerservice/v2021_08_01/_vendor.py | 27 + .../v2021_08_01/aio/__init__.py | 5 + .../v2021_08_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 117 +- .../v2021_08_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 972 ++- .../v2021_08_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../aio/operations/_snapshots_operations.py | 239 +- .../v2021_08_01/models/__init__.py | 258 +- .../models/_container_service_client_enums.py | 87 +- .../v2021_08_01/models/_models.py | 3826 ----------- .../v2021_08_01/models/_models_py3.py | 2879 +++++--- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 2026 ++++-- .../v2021_08_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../operations/_snapshots_operations.py | 525 +- .../containerservice/v2021_09_01/__init__.py | 9 +- .../v2021_09_01/_configuration.py | 19 +- .../v2021_09_01/_container_service_client.py | 126 +- .../v2021_09_01/_metadata.json | 21 +- .../containerservice/v2021_09_01/_patch.py | 31 + .../containerservice/v2021_09_01/_vendor.py | 27 + .../v2021_09_01/aio/__init__.py | 5 + .../v2021_09_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 117 +- .../v2021_09_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 349 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 972 ++- .../v2021_09_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../aio/operations/_snapshots_operations.py | 239 +- .../v2021_09_01/models/__init__.py | 261 +- .../models/_container_service_client_enums.py | 87 +- .../v2021_09_01/models/_models.py | 3899 ----------- .../v2021_09_01/models/_models_py3.py | 2926 +++++--- .../operations/_agent_pools_operations.py | 731 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 2026 ++++-- .../v2021_09_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../operations/_snapshots_operations.py | 525 +- .../containerservice/v2021_10_01/__init__.py | 9 +- .../v2021_10_01/_configuration.py | 19 +- .../v2021_10_01/_container_service_client.py | 126 +- .../v2021_10_01/_metadata.json | 21 +- .../containerservice/v2021_10_01/_patch.py | 31 + .../containerservice/v2021_10_01/_vendor.py | 27 + .../v2021_10_01/aio/__init__.py | 5 + .../v2021_10_01/aio/_configuration.py | 6 +- .../aio/_container_service_client.py | 117 +- .../v2021_10_01/aio/_patch.py | 31 + .../aio/operations/_agent_pools_operations.py | 352 +- .../_maintenance_configurations_operations.py | 168 +- .../_managed_clusters_operations.py | 972 ++- .../v2021_10_01/aio/operations/_operations.py | 45 +- ...private_endpoint_connections_operations.py | 168 +- .../_private_link_resources_operations.py | 39 +- ...olve_private_link_service_id_operations.py | 47 +- .../aio/operations/_snapshots_operations.py | 239 +- .../v2021_10_01/models/__init__.py | 261 +- .../models/_container_service_client_enums.py | 89 +- .../v2021_10_01/models/_models.py | 3924 ----------- .../v2021_10_01/models/_models_py3.py | 2959 +++++--- .../operations/_agent_pools_operations.py | 734 +- .../_maintenance_configurations_operations.py | 379 +- .../_managed_clusters_operations.py | 2026 ++++-- .../v2021_10_01/operations/_operations.py | 86 +- ...private_endpoint_connections_operations.py | 391 +- .../_private_link_resources_operations.py | 95 +- ...olve_private_link_service_id_operations.py | 115 +- .../operations/_snapshots_operations.py | 525 +- .../v2021_11_01_preview/__init__.py | 15 + .../v2021_11_01_preview/_configuration.py | 67 + .../_container_service_client.py | 122 + .../v2021_11_01_preview/_metadata.json | 109 + .../v2021_11_01_preview/_patch.py | 31 + .../v2021_11_01_preview/_vendor.py | 27 + .../v2021_11_01_preview/aio/__init__.py | 15 + .../v2021_11_01_preview/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 119 + .../v2021_11_01_preview/aio/_patch.py | 31 + .../aio/operations/__init__.py | 27 + .../aio/operations/_agent_pools_operations.py | 650 ++ .../_maintenance_configurations_operations.py | 300 + .../_managed_clusters_operations.py | 1702 +++++ .../aio/operations/_operations.py | 111 + ...private_endpoint_connections_operations.py | 330 + .../_private_link_resources_operations.py | 99 + ...olve_private_link_service_id_operations.py | 106 + .../aio/operations/_snapshots_operations.py | 412 ++ .../v2021_11_01_preview/models/__init__.py | 259 + .../models/_container_service_client_enums.py | 575 ++ .../v2021_11_01_preview/models/_models_py3.py | 5946 +++++++++++++++++ .../operations/__init__.py | 27 + .../operations/_agent_pools_operations.py | 914 +++ .../_maintenance_configurations_operations.py | 457 ++ .../_managed_clusters_operations.py | 2461 +++++++ .../operations/_operations.py | 137 + ...private_endpoint_connections_operations.py | 488 ++ .../_private_link_resources_operations.py | 136 + ...olve_private_link_service_id_operations.py | 153 + .../operations/_snapshots_operations.py | 636 ++ .../v2021_11_01_preview/py.typed | 1 + 679 files changed, 116308 insertions(+), 124657 deletions(-) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_patch.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_container_service_client_enums.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/_meta.json b/sdk/containerservice/azure-mgmt-containerservice/_meta.json index 0109ce21de65..abcd37838b7e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_meta.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.5", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.4", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "b6b834584cb58a3c2cbe887570fa0942b397dfc7", + "commit": "32c2bdc19e59cf70dd4246a975139baa7f50f08d", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/containerservice/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.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/containerservice/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/containerservice/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py index 86c0c85d090f..69983263b0d6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py @@ -12,7 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION @@ -68,4 +68,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py index 6404cfd0d101..13e9d745599a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py @@ -23,7 +23,6 @@ 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): @@ -72,12 +71,10 @@ def __init__( credential, # type: "TokenCredential" subscription_id, # type: str api_version=None, # type: Optional[str] - base_url=None, # type: Optional[str] + base_url="https://management.azure.com", # type: str profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - if not base_url: - base_url = 'https://management.azure.com' self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ContainerServiceClient, self).__init__( @@ -122,6 +119,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-08-01: :mod:`v2021_08_01.models` * 2021-09-01: :mod:`v2021_09_01.models` * 2021-10-01: :mod:`v2021_10_01.models` + * 2021-11-01-preview: :mod:`v2021_11_01_preview.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -210,6 +208,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-10-01': from .v2021_10_01 import models return models + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -238,6 +239,7 @@ def agent_pools(self): * 2021-08-01: :class:`AgentPoolsOperations` * 2021-09-01: :class:`AgentPoolsOperations` * 2021-10-01: :class:`AgentPoolsOperations` + * 2021-11-01-preview: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -284,6 +286,8 @@ def agent_pools(self): from .v2021_09_01.operations import AgentPoolsOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -313,6 +317,7 @@ def maintenance_configurations(self): * 2021-08-01: :class:`MaintenanceConfigurationsOperations` * 2021-09-01: :class:`MaintenanceConfigurationsOperations` * 2021-10-01: :class:`MaintenanceConfigurationsOperations` + * 2021-11-01-preview: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -331,6 +336,8 @@ def maintenance_configurations(self): from .v2021_09_01.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -363,6 +370,7 @@ def managed_clusters(self): * 2021-08-01: :class:`ManagedClustersOperations` * 2021-09-01: :class:`ManagedClustersOperations` * 2021-10-01: :class:`ManagedClustersOperations` + * 2021-11-01-preview: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -413,6 +421,8 @@ def managed_clusters(self): from .v2021_09_01.operations import ManagedClustersOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -467,6 +477,7 @@ def operations(self): * 2021-08-01: :class:`Operations` * 2021-09-01: :class:`Operations` * 2021-10-01: :class:`Operations` + * 2021-11-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -517,6 +528,8 @@ def operations(self): from .v2021_09_01.operations import Operations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import Operations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_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))) @@ -537,6 +550,7 @@ def private_endpoint_connections(self): * 2021-08-01: :class:`PrivateEndpointConnectionsOperations` * 2021-09-01: :class:`PrivateEndpointConnectionsOperations` * 2021-10-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-11-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -563,6 +577,8 @@ def private_endpoint_connections(self): from .v2021_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -581,6 +597,7 @@ def private_link_resources(self): * 2021-08-01: :class:`PrivateLinkResourcesOperations` * 2021-09-01: :class:`PrivateLinkResourcesOperations` * 2021-10-01: :class:`PrivateLinkResourcesOperations` + * 2021-11-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -603,6 +620,8 @@ def private_link_resources(self): from .v2021_09_01.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -621,6 +640,7 @@ def resolve_private_link_service_id(self): * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-09-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-10-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2021-11-01-preview: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -643,6 +663,8 @@ def resolve_private_link_service_id(self): from .v2021_09_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resolve_private_link_service_id'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -654,6 +676,7 @@ def snapshots(self): * 2021-08-01: :class:`SnapshotsOperations` * 2021-09-01: :class:`SnapshotsOperations` * 2021-10-01: :class:`SnapshotsOperations` + * 2021-11-01-preview: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2021-08-01': @@ -662,6 +685,8 @@ def snapshots(self): from .v2021_09_01.operations import SnapshotsOperations as OperationClass elif api_version == '2021-10-01': from .v2021_10_01.operations import SnapshotsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from .v2021_11_01_preview.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".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/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py index 9abb42e4afa1..dca41e54f61c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py @@ -12,7 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -64,4 +64,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py index 1d34ef6b51c6..b76d6dfd9f43 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py @@ -11,7 +11,6 @@ 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 @@ -21,6 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential from azure.core.credentials_async import AsyncTokenCredential class _SDKClient(object): @@ -70,12 +70,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, api_version: Optional[str] = None, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ContainerServiceClient, self).__init__( @@ -120,6 +118,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-08-01: :mod:`v2021_08_01.models` * 2021-09-01: :mod:`v2021_09_01.models` * 2021-10-01: :mod:`v2021_10_01.models` + * 2021-11-01-preview: :mod:`v2021_11_01_preview.models` """ if api_version == '2017-07-01': from ..v2017_07_01 import models @@ -208,6 +207,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-10-01': from ..v2021_10_01 import models return models + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -236,6 +238,7 @@ def agent_pools(self): * 2021-08-01: :class:`AgentPoolsOperations` * 2021-09-01: :class:`AgentPoolsOperations` * 2021-10-01: :class:`AgentPoolsOperations` + * 2021-11-01-preview: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -282,6 +285,8 @@ def agent_pools(self): from ..v2021_09_01.aio.operations import AgentPoolsOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -311,6 +316,7 @@ def maintenance_configurations(self): * 2021-08-01: :class:`MaintenanceConfigurationsOperations` * 2021-09-01: :class:`MaintenanceConfigurationsOperations` * 2021-10-01: :class:`MaintenanceConfigurationsOperations` + * 2021-11-01-preview: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -329,6 +335,8 @@ def maintenance_configurations(self): from ..v2021_09_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -361,6 +369,7 @@ def managed_clusters(self): * 2021-08-01: :class:`ManagedClustersOperations` * 2021-09-01: :class:`ManagedClustersOperations` * 2021-10-01: :class:`ManagedClustersOperations` + * 2021-11-01-preview: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -411,6 +420,8 @@ def managed_clusters(self): from ..v2021_09_01.aio.operations import ManagedClustersOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -465,6 +476,7 @@ def operations(self): * 2021-08-01: :class:`Operations` * 2021-09-01: :class:`Operations` * 2021-10-01: :class:`Operations` + * 2021-11-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -515,6 +527,8 @@ def operations(self): from ..v2021_09_01.aio.operations import Operations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import Operations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_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))) @@ -535,6 +549,7 @@ def private_endpoint_connections(self): * 2021-08-01: :class:`PrivateEndpointConnectionsOperations` * 2021-09-01: :class:`PrivateEndpointConnectionsOperations` * 2021-10-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-11-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -561,6 +576,8 @@ def private_endpoint_connections(self): from ..v2021_09_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -579,6 +596,7 @@ def private_link_resources(self): * 2021-08-01: :class:`PrivateLinkResourcesOperations` * 2021-09-01: :class:`PrivateLinkResourcesOperations` * 2021-10-01: :class:`PrivateLinkResourcesOperations` + * 2021-11-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -601,6 +619,8 @@ def private_link_resources(self): from ..v2021_09_01.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -619,6 +639,7 @@ def resolve_private_link_service_id(self): * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-09-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-10-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2021-11-01-preview: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -641,6 +662,8 @@ def resolve_private_link_service_id(self): from ..v2021_09_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resolve_private_link_service_id'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -652,6 +675,7 @@ def snapshots(self): * 2021-08-01: :class:`SnapshotsOperations` * 2021-09-01: :class:`SnapshotsOperations` * 2021-10-01: :class:`SnapshotsOperations` + * 2021-11-01-preview: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2021-08-01': @@ -660,6 +684,8 @@ def snapshots(self): from ..v2021_09_01.aio.operations import SnapshotsOperations as OperationClass elif api_version == '2021-10-01': from ..v2021_10_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2021-11-01-preview': + from ..v2021_11_01_preview.aio.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".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/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py index 085ca045efae..a63be28f17b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -66,4 +63,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py index 2e860be77ae9..5374793fefad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_container_service_client.py @@ -6,74 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse 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 . import models from ._configuration import ContainerServiceClientConfiguration from .operations import ContainerServicesOperations -from . import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar container_services: ContainerServicesOperations operations - :vartype container_services: azure.mgmt.containerservice.v2017_07_01.operations.ContainerServicesOperations + :vartype container_services: + azure.mgmt.containerservice.v2017_07_01.operations.ContainerServicesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.container_services = ContainerServicesOperations(self._client, self._config, self._serialize, self._deserialize) - self.container_services = ContainerServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json index 127b019c1259..231deacfe85b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "container_services": "ContainerServicesOperations" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py index fc5eb9216303..c2588e252184 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -62,4 +62,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py index 3285c25911c2..ce5cdbe973d5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py @@ -6,70 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest 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 .. import models from ._configuration import ContainerServiceClientConfiguration from .operations import ContainerServicesOperations -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar container_services: ContainerServicesOperations operations - :vartype container_services: azure.mgmt.containerservice.v2017_07_01.aio.operations.ContainerServicesOperations + :vartype container_services: + azure.mgmt.containerservice.v2017_07_01.aio.operations.ContainerServicesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.container_services = ContainerServicesOperations(self._client, self._config, self._serialize, self._deserialize) - self.container_services = ContainerServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py index a837c0c06264..ddbd50efa323 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._container_services_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_orchestrators_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -54,8 +60,10 @@ def list( agents, and FQDNs of masters and agents. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ContainerServiceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] + :return: An iterator like instance of either ContainerServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerServiceListResult"] @@ -63,34 +71,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ContainerServiceListResult', pipeline_response) + deserialized = self._deserialize("ContainerServiceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,6 +111,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) @@ -125,32 +129,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ContainerService') - # 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') + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ContainerService') - 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 @@ -171,8 +165,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -194,15 +191,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ContainerService or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ContainerService or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerService"] lro_delay = kwargs.pop( 'polling_interval', @@ -214,27 +216,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, container_service_name=container_service_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ContainerService', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -246,8 +242,10 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/containerServices/{containerServiceName}'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -275,27 +273,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -322,25 +312,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + subscription_id=self._config.subscription_id, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -353,6 +335,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -373,15 +357,17 @@ async def begin_delete( :type container_service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -395,21 +381,14 @@ async def begin_delete( 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -421,8 +400,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -437,8 +418,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ContainerServiceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] + :return: An iterator like instance of either ContainerServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerServiceListResult"] @@ -446,35 +429,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # 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) + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ContainerServiceListResult', pipeline_response) + deserialized = self._deserialize("ContainerServiceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -492,11 +471,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'} # type: ignore + @distributed_trace_async async def list_orchestrators( self, location: str, @@ -523,28 +504,17 @@ async def list_orchestrators( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.list_orchestrators.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_orchestrators_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.list_orchestrators.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -558,4 +528,6 @@ async def list_orchestrators( return cls(pipeline_response, deserialized, {}) return deserialized + list_orchestrators.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/__init__.py index 756ee52d39f6..51f3979cb9a3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/__init__.py @@ -6,44 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ContainerService - from ._models_py3 import ContainerServiceAgentPoolProfile - from ._models_py3 import ContainerServiceCustomProfile - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceListResult - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceOrchestratorProfile - from ._models_py3 import ContainerServicePrincipalProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import ContainerServiceWindowsProfile - from ._models_py3 import KeyVaultSecretRef - from ._models_py3 import OrchestratorProfile - from ._models_py3 import OrchestratorVersionProfile - from ._models_py3 import OrchestratorVersionProfileListResult - from ._models_py3 import Resource -except (SyntaxError, ImportError): - from ._models import ContainerService # type: ignore - from ._models import ContainerServiceAgentPoolProfile # type: ignore - from ._models import ContainerServiceCustomProfile # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceListResult # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceOrchestratorProfile # type: ignore - from ._models import ContainerServicePrincipalProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import ContainerServiceWindowsProfile # type: ignore - from ._models import KeyVaultSecretRef # type: ignore - from ._models import OrchestratorProfile # type: ignore - from ._models import OrchestratorVersionProfile # type: ignore - from ._models import OrchestratorVersionProfileListResult # type: ignore - from ._models import Resource # type: ignore +from ._models_py3 import ContainerService +from ._models_py3 import ContainerServiceAgentPoolProfile +from ._models_py3 import ContainerServiceCustomProfile +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceListResult +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceOrchestratorProfile +from ._models_py3 import ContainerServicePrincipalProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import ContainerServiceWindowsProfile +from ._models_py3 import KeyVaultSecretRef +from ._models_py3 import OrchestratorProfile +from ._models_py3 import OrchestratorVersionProfile +from ._models_py3 import OrchestratorVersionProfileListResult +from ._models_py3 import Resource + from ._container_service_client_enums import ( ContainerServiceOrchestratorTypes, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_container_service_client_enums.py index a14dea47c37f..5d7f0f6cd4c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 ContainerServiceOrchestratorTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceOrchestratorTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. """ @@ -37,7 +22,7 @@ class ContainerServiceOrchestratorTypes(with_metaclass(_CaseInsensitiveEnumMeta, DOCKER_CE = "DockerCE" CUSTOM = "Custom" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -45,7 +30,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -224,7 +209,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -233,7 +218,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models.py deleted file mode 100644 index f4993afd77c5..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models.py +++ /dev/null @@ -1,804 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ContainerService(Resource): - """Container service. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param orchestrator_profile: Profile for the container service orchestrator. - :type orchestrator_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorProfile - :param custom_profile: Properties to configure a custom container service cluster. - :type custom_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceCustomProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be - specified. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServicePrincipalProfile - :param master_profile: Profile for the container service master. - :type master_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceMasterProfile - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceAgentPoolProfile] - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceWindowsProfile - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceLinuxProfile - :param diagnostics_profile: Profile for diagnostics in the container service cluster. - :type diagnostics_profile: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'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}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'orchestrator_profile': {'key': 'properties.orchestratorProfile', 'type': 'ContainerServiceOrchestratorProfile'}, - 'custom_profile': {'key': 'properties.customProfile', 'type': 'ContainerServiceCustomProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ContainerServicePrincipalProfile'}, - 'master_profile': {'key': 'properties.masterProfile', 'type': 'ContainerServiceMasterProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ContainerServiceAgentPoolProfile]'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ContainerServiceWindowsProfile'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'ContainerServiceDiagnosticsProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerService, self).__init__(**kwargs) - self.provisioning_state = None - self.orchestrator_profile = kwargs.get('orchestrator_profile', None) - self.custom_profile = kwargs.get('custom_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.master_profile = kwargs.get('master_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.diagnostics_profile = kwargs.get('diagnostics_profile', None) - - -class ContainerServiceAgentPoolProfile(msrest.serialization.Model): - """Profile for the container service agent pool. - - Variables are only 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 name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param dns_prefix: DNS prefix to be used to create the FQDN for the agent pool. - :type dns_prefix: str - :ivar fqdn: FQDN for the agent pool. - :vartype fqdn: str - :param ports: Ports number array used to expose on this agent pool. The default opened ports - are different based on your choice of orchestrator. - :type ports: list[int] - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2017_07_01.models.OSType - """ - - _validation = { - 'name': {'required': True}, - 'count': {'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'ports': {'key': 'ports', 'type': '[int]'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs.get('count', 1) - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.ports = kwargs.get('ports', None) - self.storage_profile = kwargs.get('storage_profile', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.os_type = kwargs.get('os_type', "Linux") - - -class ContainerServiceCustomProfile(msrest.serialization.Model): - """Properties to configure a custom container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator: Required. The name of the custom orchestrator to use. - :type orchestrator: str - """ - - _validation = { - 'orchestrator': {'required': True}, - } - - _attribute_map = { - 'orchestrator': {'key': 'orchestrator', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceCustomProfile, self).__init__(**kwargs) - self.orchestrator = kwargs['orchestrator'] - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceListResult(msrest.serialization.Model): - """The response from the List Container Services operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of container services. - :type value: list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] - :ivar next_link: The URL to get the next set of container service results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ContainerService]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2017_07_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceOrchestratorProfile(msrest.serialization.Model): - """Profile for the container service orchestrator. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator_type: Required. The orchestrator to use to manage container service cluster - resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values - include: "Kubernetes", "Swarm", "DCOS", "DockerCE", "Custom". - :type orchestrator_type: str or - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorTypes - :param orchestrator_version: The version of the orchestrator to use. You can specify the - major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". - :type orchestrator_version: str - """ - - _validation = { - 'orchestrator_type': {'required': True}, - } - - _attribute_map = { - 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceOrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs['orchestrator_type'] - self.orchestrator_version = kwargs.get('orchestrator_version', None) - - -class ContainerServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - :param key_vault_secret_ref: Reference to a secret stored in Azure Key Vault. - :type key_vault_secret_ref: ~azure.mgmt.containerservice.v2017_07_01.models.KeyVaultSecretRef - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - 'key_vault_secret_ref': {'key': 'keyVaultSecretRef', 'type': 'KeyVaultSecretRef'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - self.key_vault_secret_ref = kwargs.get('key_vault_secret_ref', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class ContainerServiceWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, - 'admin_password': {'required': True, 'pattern': r'^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$'}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs['admin_password'] - - -class KeyVaultSecretRef(msrest.serialization.Model): - """Reference to a secret stored in Azure Key Vault. - - All required parameters must be populated in order to send to Azure. - - :param vault_id: Required. Key vault identifier. - :type vault_id: str - :param secret_name: Required. The secret name. - :type secret_name: str - :param version: The secret version. - :type version: str - """ - - _validation = { - 'vault_id': {'required': True}, - 'secret_name': {'required': True}, - } - - _attribute_map = { - 'vault_id': {'key': 'vaultID', 'type': 'str'}, - 'secret_name': {'key': 'secretName', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(KeyVaultSecretRef, self).__init__(**kwargs) - self.vault_id = kwargs['vault_id'] - self.secret_name = kwargs['secret_name'] - self.version = kwargs.get('version', None) - - -class OrchestratorProfile(msrest.serialization.Model): - """Contains information about orchestrator. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator_type: Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _validation = { - 'orchestrator_version': {'required': True}, - } - - _attribute_map = { - 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs.get('orchestrator_type', None) - self.orchestrator_version = kwargs['orchestrator_version'] - self.is_preview = kwargs.get('is_preview', None) - - -class OrchestratorVersionProfile(msrest.serialization.Model): - """The profile of an orchestrator and its available versions. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - :param default: Installed by default if version is not specified. - :type default: bool - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - :param upgrades: The list of available upgrade versions. - :type upgrades: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorProfile] - """ - - _validation = { - 'orchestrator_type': {'required': True}, - 'orchestrator_version': {'required': True}, - } - - _attribute_map = { - 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'default': {'key': 'default', 'type': 'bool'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(OrchestratorVersionProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs['orchestrator_type'] - self.orchestrator_version = kwargs['orchestrator_version'] - self.default = kwargs.get('default', None) - self.is_preview = kwargs.get('is_preview', None) - self.upgrades = kwargs.get('upgrades', None) - - -class OrchestratorVersionProfileListResult(msrest.serialization.Model): - """The list of versions for supported orchestrators. - - Variables are only 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: Id of the orchestrator version profile list result. - :vartype id: str - :ivar name: Name of the orchestrator version profile list result. - :vartype name: str - :ivar type: Type of the orchestrator version profile list result. - :vartype type: str - :param orchestrators: Required. List of orchestrator version profiles. - :type orchestrators: - list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'orchestrators': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.orchestrators = kwargs['orchestrators'] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py index ee4699aca38d..59476c21795f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_models_py3.py @@ -26,10 +26,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -54,6 +54,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -75,38 +81,38 @@ class ContainerService(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param orchestrator_profile: Profile for the container service orchestrator. - :type orchestrator_profile: + :ivar orchestrator_profile: Profile for the container service orchestrator. + :vartype orchestrator_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorProfile - :param custom_profile: Properties to configure a custom container service cluster. - :type custom_profile: + :ivar custom_profile: Properties to configure a custom container service cluster. + :vartype custom_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceCustomProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. - :type service_principal_profile: + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServicePrincipalProfile - :param master_profile: Profile for the container service master. - :type master_profile: + :ivar master_profile: Profile for the container service master. + :vartype master_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceMasterProfile - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceAgentPoolProfile] - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceWindowsProfile - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceLinuxProfile - :param diagnostics_profile: Profile for diagnostics in the container service cluster. - :type diagnostics_profile: + :ivar diagnostics_profile: Profile for diagnostics in the container service cluster. + :vartype diagnostics_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile """ @@ -150,6 +156,38 @@ def __init__( diagnostics_profile: Optional["ContainerServiceDiagnosticsProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword orchestrator_profile: Profile for the container service orchestrator. + :paramtype orchestrator_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorProfile + :keyword custom_profile: Properties to configure a custom container service cluster. + :paramtype custom_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceCustomProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be + specified. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServicePrincipalProfile + :keyword master_profile: Profile for the container service master. + :paramtype master_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceMasterProfile + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceAgentPoolProfile] + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceWindowsProfile + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceLinuxProfile + :keyword diagnostics_profile: Profile for diagnostics in the container service cluster. + :paramtype diagnostics_profile: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile + """ super(ContainerService, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.orchestrator_profile = orchestrator_profile @@ -169,13 +207,13 @@ class ContainerServiceAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :vartype name: str + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -213,29 +251,29 @@ class ContainerServiceAgentPoolProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param dns_prefix: DNS prefix to be used to create the FQDN for the agent pool. - :type dns_prefix: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar dns_prefix: DNS prefix to be used to create the FQDN for the agent pool. + :vartype dns_prefix: str :ivar fqdn: FQDN for the agent pool. :vartype fqdn: str - :param ports: Ports number array used to expose on this agent pool. The default opened ports - are different based on your choice of orchestrator. - :type ports: list[int] - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar ports: Ports number array used to expose on this agent pool. The default opened ports are + different based on your choice of orchestrator. + :vartype ports: list[int] + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2017_07_01.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2017_07_01.models.OSType """ _validation = { @@ -273,6 +311,73 @@ def __init__( os_type: Optional[Union[str, "OSType"]] = "Linux", **kwargs ): + """ + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword dns_prefix: DNS prefix to be used to create the FQDN for the agent pool. + :paramtype dns_prefix: str + :keyword ports: Ports number array used to expose on this agent pool. The default opened ports + are different based on your choice of orchestrator. + :paramtype ports: list[int] + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2017_07_01.models.OSType + """ super(ContainerServiceAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -291,8 +396,8 @@ class ContainerServiceCustomProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator: Required. The name of the custom orchestrator to use. - :type orchestrator: str + :ivar orchestrator: Required. The name of the custom orchestrator to use. + :vartype orchestrator: str """ _validation = { @@ -309,6 +414,10 @@ def __init__( orchestrator: str, **kwargs ): + """ + :keyword orchestrator: Required. The name of the custom orchestrator to use. + :paramtype orchestrator: str + """ super(ContainerServiceCustomProfile, self).__init__(**kwargs) self.orchestrator = orchestrator @@ -318,8 +427,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMDiagnostics """ @@ -337,6 +446,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -346,10 +460,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -369,6 +483,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -379,8 +500,8 @@ class ContainerServiceListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of container services. - :type value: list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] + :ivar value: The list of container services. + :vartype value: list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] :ivar next_link: The URL to get the next set of container service results. :vartype next_link: str """ @@ -400,6 +521,10 @@ def __init__( value: Optional[List["ContainerService"]] = None, **kwargs ): + """ + :keyword value: The list of container services. + :paramtype value: list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] + """ super(ContainerServiceListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -412,12 +537,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2017_07_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2017_07_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -455,21 +580,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -498,13 +623,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2017_07_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -521,14 +707,14 @@ class ContainerServiceOrchestratorProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. The orchestrator to use to manage container service cluster + :ivar orchestrator_type: Required. The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values include: "Kubernetes", "Swarm", "DCOS", "DockerCE", "Custom". - :type orchestrator_type: str or + :vartype orchestrator_type: str or ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorTypes - :param orchestrator_version: The version of the orchestrator to use. You can specify the + :ivar orchestrator_version: The version of the orchestrator to use. You can specify the major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". - :type orchestrator_version: str + :vartype orchestrator_version: str """ _validation = { @@ -547,6 +733,16 @@ def __init__( orchestrator_version: Optional[str] = None, **kwargs ): + """ + :keyword orchestrator_type: Required. The orchestrator to use to manage container service + cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible + values include: "Kubernetes", "Swarm", "DCOS", "DockerCE", "Custom". + :paramtype orchestrator_type: str or + ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorTypes + :keyword orchestrator_version: The version of the orchestrator to use. You can specify the + major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + :paramtype orchestrator_version: str + """ super(ContainerServiceOrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -557,12 +753,13 @@ class ContainerServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - :param key_vault_secret_ref: Reference to a secret stored in Azure Key Vault. - :type key_vault_secret_ref: ~azure.mgmt.containerservice.v2017_07_01.models.KeyVaultSecretRef + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str + :ivar key_vault_secret_ref: Reference to a secret stored in Azure Key Vault. + :vartype key_vault_secret_ref: + ~azure.mgmt.containerservice.v2017_07_01.models.KeyVaultSecretRef """ _validation = { @@ -583,6 +780,15 @@ def __init__( key_vault_secret_ref: Optional["KeyVaultSecretRef"] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + :keyword key_vault_secret_ref: Reference to a secret stored in Azure Key Vault. + :paramtype key_vault_secret_ref: + ~azure.mgmt.containerservice.v2017_07_01.models.KeyVaultSecretRef + """ super(ContainerServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -594,9 +800,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshPublicKey] """ @@ -614,6 +820,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -623,9 +835,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -642,6 +854,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -653,8 +870,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -675,6 +892,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -685,10 +906,10 @@ class ContainerServiceWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str + :ivar admin_username: Required. The administrator username to use for Windows VMs. + :vartype admin_username: str + :ivar admin_password: Required. The administrator password to use for Windows VMs. + :vartype admin_password: str """ _validation = { @@ -708,6 +929,12 @@ def __init__( admin_password: str, **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Windows VMs. + :paramtype admin_username: str + :keyword admin_password: Required. The administrator password to use for Windows VMs. + :paramtype admin_password: str + """ super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -718,12 +945,12 @@ class KeyVaultSecretRef(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vault_id: Required. Key vault identifier. - :type vault_id: str - :param secret_name: Required. The secret name. - :type secret_name: str - :param version: The secret version. - :type version: str + :ivar vault_id: Required. Key vault identifier. + :vartype vault_id: str + :ivar secret_name: Required. The secret name. + :vartype secret_name: str + :ivar version: The secret version. + :vartype version: str """ _validation = { @@ -745,6 +972,14 @@ def __init__( version: Optional[str] = None, **kwargs ): + """ + :keyword vault_id: Required. Key vault identifier. + :paramtype vault_id: str + :keyword secret_name: Required. The secret name. + :paramtype secret_name: str + :keyword version: The secret version. + :paramtype version: str + """ super(KeyVaultSecretRef, self).__init__(**kwargs) self.vault_id = vault_id self.secret_name = secret_name @@ -756,12 +991,12 @@ class OrchestratorProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar orchestrator_type: Orchestrator type. + :vartype orchestrator_type: str + :ivar orchestrator_version: Required. Orchestrator version (major, minor, patch). + :vartype orchestrator_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _validation = { @@ -782,6 +1017,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword orchestrator_type: Orchestrator type. + :paramtype orchestrator_type: str + :keyword orchestrator_version: Required. Orchestrator version (major, minor, patch). + :paramtype orchestrator_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -793,16 +1036,16 @@ class OrchestratorVersionProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - :param default: Installed by default if version is not specified. - :type default: bool - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - :param upgrades: The list of available upgrade versions. - :type upgrades: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorProfile] + :ivar orchestrator_type: Required. Orchestrator type. + :vartype orchestrator_type: str + :ivar orchestrator_version: Required. Orchestrator version (major, minor, patch). + :vartype orchestrator_version: str + :ivar default: Installed by default if version is not specified. + :vartype default: bool + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool + :ivar upgrades: The list of available upgrade versions. + :vartype upgrades: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorProfile] """ _validation = { @@ -828,6 +1071,18 @@ def __init__( upgrades: Optional[List["OrchestratorProfile"]] = None, **kwargs ): + """ + :keyword orchestrator_type: Required. Orchestrator type. + :paramtype orchestrator_type: str + :keyword orchestrator_version: Required. Orchestrator version (major, minor, patch). + :paramtype orchestrator_version: str + :keyword default: Installed by default if version is not specified. + :paramtype default: bool + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + :keyword upgrades: The list of available upgrade versions. + :paramtype upgrades: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorProfile] + """ super(OrchestratorVersionProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -849,8 +1104,8 @@ class OrchestratorVersionProfileListResult(msrest.serialization.Model): :vartype name: str :ivar type: Type of the orchestrator version profile list result. :vartype type: str - :param orchestrators: Required. List of orchestrator version profiles. - :type orchestrators: + :ivar orchestrators: Required. List of orchestrator version profiles. + :vartype orchestrators: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfile] """ @@ -874,6 +1129,11 @@ def __init__( orchestrators: List["OrchestratorVersionProfile"], **kwargs ): + """ + :keyword orchestrators: Required. List of orchestrator version profiles. + :paramtype orchestrators: + list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfile] + """ super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) self.id = None self.name = None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py index 93392d039d2e..da8ea54b8d71 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/_container_services_operations.py @@ -5,25 +5,237 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2017-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name: str, + container_service_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2017-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "containerServiceName": _SERIALIZER.url("container_service_name", container_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + resource_group_name: str, + container_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2017-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "containerServiceName": _SERIALIZER.url("container_service_name", container_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name: str, + container_service_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2017-07-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "containerServiceName": _SERIALIZER.url("container_service_name", container_service_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2017-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_orchestrators_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ContainerServicesOperations(object): """ContainerServicesOperations operations. @@ -47,11 +259,11 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ContainerServiceListResult"] + **kwargs: Any + ) -> Iterable["_models.ContainerServiceListResult"]: """Gets a list of container services in the specified subscription. Gets a list of container services in the specified subscription. The operation returns @@ -59,8 +271,10 @@ def list( agents, and FQDNs of masters and agents. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ContainerServiceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] + :return: An iterator like instance of either ContainerServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerServiceListResult"] @@ -68,34 +282,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ContainerServiceListResult', pipeline_response) + deserialized = self._deserialize("ContainerServiceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,6 +322,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) @@ -120,43 +330,32 @@ def get_next(next_link=None): def _create_or_update_initial( self, - resource_group_name, # type: str - container_service_name, # type: str - parameters, # type: "_models.ContainerService" - **kwargs # type: Any - ): - # type: (...) -> "_models.ContainerService" + resource_group_name: str, + container_service_name: str, + parameters: "_models.ContainerService", + **kwargs: Any + ) -> "_models.ContainerService": cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ContainerService') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ContainerService') - 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 @@ -177,16 +376,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - container_service_name, # type: str - parameters, # type: "_models.ContainerService" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ContainerService"] + resource_group_name: str, + container_service_name: str, + parameters: "_models.ContainerService", + **kwargs: Any + ) -> LROPoller["_models.ContainerService"]: """Creates or updates a container service. Creates or updates a container service with the specified configuration of orchestrator, @@ -201,15 +402,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ContainerService or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ContainerService or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerService"] lro_delay = kwargs.pop( 'polling_interval', @@ -221,27 +427,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, container_service_name=container_service_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ContainerService', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -253,15 +453,16 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/containerServices/{containerServiceName}'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - container_service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ContainerService" + resource_group_name: str, + container_service_name: str, + **kwargs: Any + ) -> "_models.ContainerService": """Gets the properties of the specified container service. Gets the properties of the specified container service in the specified subscription and @@ -283,27 +484,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,39 +508,32 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - container_service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + container_service_name: str, + **kwargs: Any + ) -> 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 = "2017-07-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + subscription_id=self._config.subscription_id, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -362,13 +546,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - container_service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + container_service_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes the specified container service. Deletes the specified container service in the specified subscription and resource group. The @@ -383,15 +568,17 @@ def begin_delete( :type container_service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -405,21 +592,14 @@ def begin_delete( 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'containerServiceName': self._serialize.url("container_service_name", container_service_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -431,14 +611,15 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ContainerServiceListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ContainerServiceListResult"]: """Gets a list of container services in the specified resource group. Gets a list of container services in the specified subscription and resource group. The @@ -448,8 +629,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ContainerServiceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] + :return: An iterator like instance of either ContainerServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerServiceListResult"] @@ -457,35 +640,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-07-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # 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) + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ContainerServiceListResult', pipeline_response) + deserialized = self._deserialize("ContainerServiceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -503,18 +682,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'} # type: ignore + @distributed_trace def list_orchestrators( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OrchestratorVersionProfileListResult" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OrchestratorVersionProfileListResult": """Gets a list of supported orchestrators in the specified subscription. Gets a list of supported orchestrators in the specified subscription. The operation returns @@ -535,28 +715,17 @@ def list_orchestrators( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.list_orchestrators.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_orchestrators_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.list_orchestrators.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -570,4 +739,6 @@ def list_orchestrators( return cls(pipeline_response, deserialized, {}) return deserialized + list_orchestrators.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py index a872f97a5b73..e88f30b9341d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_container_service_client.py index fa1dd4a39cea..e1eb17ecf782 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_container_service_client.py @@ -6,79 +6,83 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2018_03_31.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2018_03_31.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2018_03_31.operations.ManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json index 6f42ac81759c..b568efd6a7dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py index 4d7a9d2af15e..97675d45ae8d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_container_service_client.py index 3818543a33b1..c3d4666441af 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_container_service_client.py @@ -6,75 +6,83 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2018_03_31.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2018_03_31.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2018_03_31.aio.operations.ManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py index 628d13391185..7d64b1fa35e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -455,27 +432,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -489,8 +456,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -503,32 +472,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -546,8 +505,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -568,15 +530,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -588,27 +555,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -620,6 +581,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -634,32 +596,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -673,8 +625,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -694,15 +649,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +674,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +700,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -759,25 +714,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -790,6 +737,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -806,15 +755,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -828,21 +779,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -854,6 +798,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -868,30 +813,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -904,6 +841,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -921,18 +860,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -944,24 +887,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -973,6 +910,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -987,30 +925,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1023,6 +953,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1043,15 +975,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1063,24 +998,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1092,4 +1021,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py index 8c05d7d4a6d8..43f0426e7df9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/__init__.py index 385fd0835eab..f44d371e62f3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/__init__.py @@ -6,56 +6,31 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import ContainerServiceWindowsProfile - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OrchestratorProfile - from ._models_py3 import Resource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import ContainerServiceWindowsProfile # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OrchestratorProfile # type: ignore - from ._models import Resource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import ContainerServiceWindowsProfile +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OrchestratorProfile +from ._models_py3 import Resource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( ContainerServiceStorageProfileTypes, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_container_service_client_enums.py index 0ad42f25cc34..139990e598ab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -34,7 +19,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -213,7 +198,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -222,20 +207,20 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models.py deleted file mode 100644 index f6f3b9bc5b08..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models.py +++ /dev/null @@ -1,1023 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2018_03_31.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico". - :type network_policy: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class ContainerServiceWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, - 'admin_password': {'required': True, 'pattern': r'^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$'}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs['admin_password'] - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2018_03_31.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. Currently only one agent pool can - exist. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceLinuxProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAddonProfile] - :ivar node_resource_group: Name of the resource group containing agent pool nodes. - :vartype node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'node_resource_group': {'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}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.provisioning_state = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = None - self.enable_rbac = kwargs.get('enable_rbac', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfile(msrest.serialization.Model): - """Profile for the container service agent pool. - - Variables are only 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 name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :ivar storage_profile: Storage profile specifies what kind of storage used. Defaults to - ManagedDisks. Possible values include: "StorageAccount", "ManagedDisks". - :vartype storage_profile: str or - ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceStorageProfileTypes - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType - """ - - _validation = { - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - 'count': {'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'storage_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs.get('count', 1) - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.storage_profile = None - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2018_03_31.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OrchestratorProfile(msrest.serialization.Model): - """Contains information about orchestrator. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - """ - - _validation = { - 'orchestrator_type': {'required': True}, - 'orchestrator_version': {'required': True}, - } - - _attribute_map = { - 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs['orchestrator_type'] - self.orchestrator_version = kwargs['orchestrator_version'] - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models_py3.py index 061214a2b5d3..6bcca5f22652 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_models_py3.py @@ -18,8 +18,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMDiagnostics """ @@ -37,6 +37,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -46,10 +51,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration """ _validation = { @@ -69,6 +74,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -81,12 +93,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2018_03_31.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2018_03_31.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -124,21 +136,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -167,13 +179,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2018_03_31.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -188,23 +261,23 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico". - :type network_policy: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str + :vartype docker_bridge_cidr: str """ _validation = { @@ -234,6 +307,25 @@ def __init__( docker_bridge_cidr: Optional[str] = "172.17.0.1/16", **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2018_03_31.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -248,9 +340,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshPublicKey] """ @@ -268,6 +360,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -277,9 +375,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -296,6 +394,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -307,8 +410,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -329,6 +432,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -339,10 +446,10 @@ class ContainerServiceWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str + :ivar admin_username: Required. The administrator username to use for Windows VMs. + :vartype admin_username: str + :ivar admin_password: Required. The administrator password to use for Windows VMs. + :vartype admin_password: str """ _validation = { @@ -362,6 +469,12 @@ def __init__( admin_password: str, **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Windows VMs. + :paramtype admin_username: str + :keyword admin_password: Required. The administrator password to use for Windows VMs. + :paramtype admin_password: str + """ super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -392,6 +505,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -418,6 +533,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -435,10 +552,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -463,6 +580,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -484,42 +607,42 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. Currently only one agent pool can + :ivar agent_pool_profiles: Properties of the agent pool. Currently only one agent pool can exist. - :type agent_pool_profiles: + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceLinuxProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAddonProfile] :ivar node_resource_group: Name of the resource group containing agent pool nodes. :vartype node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile """ _validation = { @@ -568,6 +691,38 @@ def __init__( aad_profile: Optional["ManagedClusterAADProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. Currently only one agent pool can + exist. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceLinuxProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAddonProfile] + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.kubernetes_version = kubernetes_version @@ -588,15 +743,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -620,6 +775,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -640,12 +806,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -672,6 +838,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -681,10 +855,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -703,6 +877,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -715,13 +895,13 @@ class ManagedClusterAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :vartype name: str + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -759,23 +939,23 @@ class ManagedClusterAgentPoolProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int :ivar storage_profile: Storage profile specifies what kind of storage used. Defaults to ManagedDisks. Possible values include: "StorageAccount", "ManagedDisks". :vartype storage_profile: str or ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceStorageProfileTypes - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType """ _validation = { @@ -809,6 +989,65 @@ def __init__( os_type: Optional[Union[str, "OSType"]] = "Linux", **kwargs ): + """ + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType + """ super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -825,8 +1064,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -846,6 +1085,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -856,15 +1099,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] + :vartype os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[str] """ _validation = { @@ -888,6 +1131,17 @@ def __init__( upgrades: Optional[List[str]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2018_03_31.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: list[str] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -900,10 +1154,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -922,6 +1176,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -940,12 +1200,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPoolUpgradeProfile] """ @@ -972,6 +1232,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1001,6 +1270,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1046,6 +1317,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1060,10 +1333,10 @@ class OrchestratorProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str + :ivar orchestrator_type: Required. Orchestrator type. + :vartype orchestrator_type: str + :ivar orchestrator_version: Required. Orchestrator version (major, minor, patch). + :vartype orchestrator_version: str """ _validation = { @@ -1083,6 +1356,12 @@ def __init__( orchestrator_version: str, **kwargs ): + """ + :keyword orchestrator_type: Required. Orchestrator type. + :paramtype orchestrator_type: str + :keyword orchestrator_version: Required. Orchestrator version (major, minor, patch). + :paramtype orchestrator_version: str + """ super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -1091,8 +1370,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1105,5 +1384,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py index 9cff3df58547..d350c3ff28f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py @@ -5,25 +5,470 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-03-31" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-03-31" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +492,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +514,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +554,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +574,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +585,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +627,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +659,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +683,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +716,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +741,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +770,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +794,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +823,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +847,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -466,27 +876,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -500,47 +900,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -558,16 +949,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -581,15 +974,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -601,27 +999,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -633,47 +1025,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -687,16 +1069,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -709,15 +1093,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1118,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,39 +1144,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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 = "2018-03-31" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -806,13 +1181,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -823,15 +1199,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -845,21 +1223,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -871,45 +1242,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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 = "2018-03-31" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -922,14 +1285,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -940,18 +1304,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -963,24 +1331,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -992,45 +1354,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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 = "2018-03-31" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1043,14 +1397,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1064,15 +1419,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1084,24 +1442,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1113,4 +1465,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py index ac93312e1dbd..c1d023cd2407 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2018-03-31" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_03_31.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-03-31" - 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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py index 7e911e15153f..0ab0966f931c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_container_service_client.py index 599f95587e3e..322ba35a1ba1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_container_service_client.py @@ -6,79 +6,83 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2018_08_01_preview.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2018_08_01_preview.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2018_08_01_preview.operations.ManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json index f128c982311f..de423bd8dedc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py index a1c6f5c83665..d1a5f504a7f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_container_service_client.py index 8407b4ff82ed..42fb4ed1f41a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_container_service_client.py @@ -6,75 +6,83 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2018_08_01_preview.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2018_08_01_preview.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2018_08_01_preview.aio.operations.ManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py index 94aad6069c29..b32c58010a13 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -455,27 +432,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -489,8 +456,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -503,32 +472,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -546,8 +505,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -568,15 +530,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -588,27 +555,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -620,6 +581,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -634,32 +596,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -673,8 +625,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -694,15 +649,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +674,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +700,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -759,25 +714,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -790,6 +737,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -806,15 +755,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -828,21 +779,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -854,6 +798,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -868,32 +813,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -906,6 +841,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -923,18 +860,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -946,24 +887,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -975,6 +910,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -989,32 +925,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1027,6 +953,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1044,18 +972,22 @@ async def begin_reset_aad_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile + :type parameters: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1067,24 +999,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1096,4 +1022,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py index 082a16159246..c01695fc9156 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/__init__.py index 5db8537cc98f..973922e9e06d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/__init__.py @@ -6,58 +6,32 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import ContainerServiceWindowsProfile - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OrchestratorProfile - from ._models_py3 import Resource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import ContainerServiceWindowsProfile # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OrchestratorProfile # type: ignore - from ._models import Resource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import ContainerServiceWindowsProfile +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OrchestratorProfile +from ._models_py3 import Resource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_container_service_client_enums.py index fd8069165b50..aa7c375fed85 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -41,7 +26,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -220,7 +205,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -229,20 +214,20 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models.py deleted file mode 100644 index 5318c751c63f..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models.py +++ /dev/null @@ -1,1069 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or - ~azure.mgmt.containerservice.v2018_08_01_preview.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico". - :type network_policy: str or - ~azure.mgmt.containerservice.v2018_08_01_preview.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class ContainerServiceWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, - 'admin_password': {'required': True, 'pattern': r'^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$'}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs['admin_password'] - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: - list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceLinuxProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAddonProfile] - :ivar node_resource_group: Name of the resource group containing agent pool nodes. - :vartype node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'node_resource_group': {'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}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.provisioning_state = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = None - self.enable_rbac = kwargs.get('enable_rbac', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfile(msrest.serialization.Model): - """Profile for the container service agent pool. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.AgentPoolType - """ - - _validation = { - 'name': {'required': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs.get('count', 1) - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OrchestratorProfile(msrest.serialization.Model): - """Contains information about orchestrator. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - """ - - _validation = { - 'orchestrator_type': {'required': True}, - 'orchestrator_version': {'required': True}, - } - - _attribute_map = { - 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs['orchestrator_type'] - self.orchestrator_version = kwargs['orchestrator_version'] - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models_py3.py index 2d648536be39..09ae71717b3b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_models_py3.py @@ -16,17 +16,17 @@ class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -45,6 +45,20 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -57,8 +71,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMDiagnostics """ @@ -76,6 +90,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -85,10 +104,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshConfiguration """ @@ -109,6 +128,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -121,12 +147,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2018_08_01_preview.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -164,21 +190,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -207,13 +233,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2018_08_01_preview.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -228,25 +315,25 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico". - :type network_policy: str or + :vartype network_policy: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str + :vartype docker_bridge_cidr: str """ _validation = { @@ -276,6 +363,27 @@ def __init__( docker_bridge_cidr: Optional[str] = "172.17.0.1/16", **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or + ~azure.mgmt.containerservice.v2018_08_01_preview.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico". + :paramtype network_policy: str or + ~azure.mgmt.containerservice.v2018_08_01_preview.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -290,9 +398,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshPublicKey] """ @@ -310,6 +418,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -319,9 +433,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -338,6 +452,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -349,8 +468,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -371,6 +490,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -381,10 +504,10 @@ class ContainerServiceWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str + :ivar admin_username: Required. The administrator username to use for Windows VMs. + :vartype admin_username: str + :ivar admin_password: Required. The administrator password to use for Windows VMs. + :vartype admin_password: str """ _validation = { @@ -404,6 +527,12 @@ def __init__( admin_password: str, **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Windows VMs. + :paramtype admin_username: str + :keyword admin_password: Required. The administrator password to use for Windows VMs. + :paramtype admin_password: str + """ super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -434,6 +563,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -461,6 +592,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -478,10 +611,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -506,6 +639,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -527,41 +666,41 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceLinuxProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAddonProfile] :ivar node_resource_group: Name of the resource group containing agent pool nodes. :vartype node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile """ @@ -611,6 +750,37 @@ def __init__( aad_profile: Optional["ManagedClusterAADProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceLinuxProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAddonProfile] + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.kubernetes_version = kubernetes_version @@ -631,15 +801,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -663,6 +833,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -683,12 +864,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -715,6 +896,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -724,10 +913,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -746,6 +935,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -756,13 +951,13 @@ class ManagedClusterAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :vartype name: str + :ivar count: Required. Number of agents (VMs) to host docker containers. Allowed values must be + in the range of 1 to 100 (inclusive). The default value is 1. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -800,28 +995,28 @@ class ManagedClusterAgentPoolProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.AgentPoolType + :vartype type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.AgentPoolType """ _validation = { @@ -861,6 +1056,74 @@ def __init__( type: Optional[Union[str, "AgentPoolType"]] = None, **kwargs ): + """ + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + :keyword count: Required. Number of agents (VMs) to host docker containers. Allowed values must + be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.AgentPoolType + """ super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -880,8 +1143,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -901,6 +1164,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -911,15 +1178,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] + :vartype os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[str] """ _validation = { @@ -943,6 +1210,17 @@ def __init__( upgrades: Optional[List[str]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2018_08_01_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: list[str] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -955,10 +1233,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -977,6 +1255,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -995,12 +1279,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPoolUpgradeProfile] """ @@ -1027,6 +1311,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1056,6 +1349,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1101,6 +1396,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1115,10 +1412,10 @@ class OrchestratorProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str + :ivar orchestrator_type: Required. Orchestrator type. + :vartype orchestrator_type: str + :ivar orchestrator_version: Required. Orchestrator version (major, minor, patch). + :vartype orchestrator_version: str """ _validation = { @@ -1138,6 +1435,12 @@ def __init__( orchestrator_version: str, **kwargs ): + """ + :keyword orchestrator_type: Required. Orchestrator type. + :paramtype orchestrator_type: str + :keyword orchestrator_version: Required. Orchestrator version (major, minor, patch). + :paramtype orchestrator_version: str + """ super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -1146,8 +1449,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1160,5 +1463,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py index 25730ea530da..f5e987c995e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py @@ -5,25 +5,474 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +496,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +518,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +558,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +578,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +589,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +631,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +663,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +687,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +720,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +745,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +774,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +798,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +827,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +851,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -466,27 +880,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -500,47 +904,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -558,16 +953,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -581,15 +978,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -601,27 +1003,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -633,47 +1029,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -687,16 +1073,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -709,15 +1097,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1122,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,39 +1148,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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 = "2018-08-01-preview" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -806,13 +1185,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -823,15 +1203,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -845,21 +1227,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -871,47 +1246,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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 = "2018-08-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -924,14 +1289,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -942,18 +1308,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -965,24 +1335,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -994,47 +1358,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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 = "2018-08-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1047,14 +1401,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1065,18 +1420,22 @@ def begin_reset_aad_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile + :type parameters: + ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1088,24 +1447,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1117,4 +1470,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py index 2bfc26be7ed3..1c63edcc951b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-08-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py index a16842a6223e..3b7cce0e510d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_container_service_client.py index 7c5e208efa4a..4dab87ebd90c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_container_service_client.py @@ -6,74 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse 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 . import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from . import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json index 527d5ea4447d..3546e1aa9b9f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py index 3e4dda8d5954..0daba177f577 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_container_service_client.py index 9dfecdc93039..6000f505f8b7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_container_service_client.py @@ -6,70 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest 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 .. import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2018_09_30_preview.aio.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2018_09_30_preview.aio.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py index 468b8a8564ee..d69dcb99fe91 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._open_shift_managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -209,27 +214,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -243,8 +238,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -257,32 +254,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -300,8 +287,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -320,18 +310,24 @@ async def begin_create_or_update( :type resource_name: str :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - :type parameters: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster + :type parameters: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -343,27 +339,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -375,6 +365,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -389,32 +380,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -428,8 +409,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -449,15 +433,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2018_09_30_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -469,27 +458,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -501,6 +484,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -514,27 +498,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -547,6 +521,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -563,15 +539,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -585,21 +563,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -611,4 +582,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/__init__.py index 68a09f6ce11d..35292467d6d1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/__init__.py @@ -6,36 +6,21 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import CloudErrorBody - from ._models_py3 import NetworkProfile - from ._models_py3 import OpenShiftManagedCluster - from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider - from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile - from ._models_py3 import OpenShiftManagedClusterAuthProfile - from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider - from ._models_py3 import OpenShiftManagedClusterIdentityProvider - from ._models_py3 import OpenShiftManagedClusterListResult - from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile - from ._models_py3 import OpenShiftRouterProfile - from ._models_py3 import PurchasePlan - from ._models_py3 import Resource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import CloudErrorBody # type: ignore - from ._models import NetworkProfile # type: ignore - from ._models import OpenShiftManagedCluster # type: ignore - from ._models import OpenShiftManagedClusterAADIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterAgentPoolProfile # type: ignore - from ._models import OpenShiftManagedClusterAuthProfile # type: ignore - from ._models import OpenShiftManagedClusterBaseIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterListResult # type: ignore - from ._models import OpenShiftManagedClusterMasterPoolProfile # type: ignore - from ._models import OpenShiftRouterProfile # type: ignore - from ._models import PurchasePlan # type: ignore - from ._models import Resource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import CloudErrorBody +from ._models_py3 import NetworkProfile +from ._models_py3 import OpenShiftManagedCluster +from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider +from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile +from ._models_py3 import OpenShiftManagedClusterAuthProfile +from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider +from ._models_py3 import OpenShiftManagedClusterIdentityProvider +from ._models_py3 import OpenShiftManagedClusterListResult +from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile +from ._models_py3 import OpenShiftRouterProfile +from ._models_py3 import PurchasePlan +from ._models_py3 import Resource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( OSType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_container_service_client_enums.py index 05a77b92092e..9cff02877c35 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftAgentPoolProfileRole(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. """ COMPUTE = "compute" INFRA = "infra" -class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftContainerServiceVMSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of OpenShift VMs. """ @@ -71,7 +56,7 @@ class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, s STANDARD_L16_S = "Standard_L16s" STANDARD_L32_S = "Standard_L32s" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models.py deleted file mode 100644 index 6bd682db6861..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models.py +++ /dev/null @@ -1,542 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class NetworkProfile(msrest.serialization.Model): - """Represents the OpenShift networking configuration. - - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param peer_vnet_id: CIDR of the Vnet to peer. - :type peer_vnet_id: str - """ - - _attribute_map = { - 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, - 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkProfile, self).__init__(**kwargs) - self.vnet_cidr = kwargs.get('vnet_cidr', "10.0.0.0/8") - self.peer_vnet_id = kwargs.get('peer_vnet_id', None) - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class OpenShiftManagedCluster(Resource): - """OpenShift Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2018_09_30_preview.models.PurchasePlan - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str - :param public_hostname: Optional user-specified FQDN for OpenShift API server. - :type public_hostname: str - :param fqdn: User-specified FQDN for OpenShift API server loadbalancer internal hostname. - :type fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2018_09_30_preview.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: - list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterAuthProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'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}'}, - 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'open_shift_version': {'key': 'properties.openShiftVersion', 'type': 'str'}, - 'public_hostname': {'key': 'properties.publicHostname', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, - 'router_profiles': {'key': 'properties.routerProfiles', 'type': '[OpenShiftRouterProfile]'}, - 'master_pool_profile': {'key': 'properties.masterPoolProfile', 'type': 'OpenShiftManagedClusterMasterPoolProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[OpenShiftManagedClusterAgentPoolProfile]'}, - 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedCluster, self).__init__(**kwargs) - self.plan = kwargs.get('plan', None) - self.provisioning_state = None - self.open_shift_version = kwargs.get('open_shift_version', None) - self.public_hostname = kwargs.get('public_hostname', None) - self.fqdn = kwargs.get('fqdn', None) - self.network_profile = kwargs.get('network_profile', None) - self.router_profiles = kwargs.get('router_profiles', None) - self.master_pool_profile = kwargs.get('master_pool_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.auth_profile = kwargs.get('auth_profile', None) - - -class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): - """Structure for any Identity provider. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: OpenShiftManagedClusterAADIdentityProvider. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None # type: Optional[str] - - -class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): - """Defines the Identity provider for MS AAD. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) - self.kind = 'AADIdentityProvider' # type: str - self.client_id = kwargs.get('client_id', None) - self.secret = kwargs.get('secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.customer_admin_group_id = kwargs.get('customer_admin_group_id', None) - - -class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): - """Defines the configuration of the OpenShift cluster VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Unique name of the pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", - "infra". - :type role: str or - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftAgentPoolProfileRole - """ - - _validation = { - 'name': {'required': True}, - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', "10.0.0.0/24") - self.os_type = kwargs.get('os_type', "Linux") - self.role = kwargs.get('role', None) - - -class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): - """Defines all possible authentication profiles for the OpenShift cluster. - - :param identity_providers: Type of authentication profile to use. - :type identity_providers: - list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterIdentityProvider] - """ - - _attribute_map = { - 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) - self.identity_providers = kwargs.get('identity_providers', None) - - -class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): - """Defines the configuration of the identity providers to be used in the OpenShift cluster. - - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterBaseIdentityProvider - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.provider = kwargs.get('provider', None) - - -class OpenShiftManagedClusterListResult(msrest.serialization.Model): - """The response from the List OpenShift Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of OpenShift managed clusters. - :type value: - list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :ivar next_link: The URL to get the next set of OpenShift managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OpenShiftManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Unique name of the master pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of masters (VMs) to host docker containers. The default value is - 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType - """ - - _validation = { - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', None) - self.os_type = kwargs.get('os_type', "Linux") - - -class OpenShiftRouterProfile(msrest.serialization.Model): - """Represents an OpenShift router. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Name of the router profile. - :type name: str - :param public_subdomain: DNS subdomain for OpenShift router. - :type public_subdomain: str - :ivar fqdn: Auto-allocated FQDN for the OpenShift router. - :vartype fqdn: str - """ - - _validation = { - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'public_subdomain': {'key': 'publicSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftRouterProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.public_subdomain = kwargs.get('public_subdomain', None) - self.fqdn = None - - -class PurchasePlan(msrest.serialization.Model): - """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value - as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PurchasePlan, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.product = kwargs.get('product', None) - self.promotion_code = kwargs.get('promotion_code', None) - self.publisher = kwargs.get('publisher', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models_py3.py index dba1ae7343c8..3fe2805c341a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_models_py3.py @@ -16,17 +16,17 @@ class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody] """ _attribute_map = { @@ -45,6 +45,20 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -55,10 +69,10 @@ def __init__( class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param peer_vnet_id: CIDR of the Vnet to peer. - :type peer_vnet_id: str + :ivar vnet_cidr: CIDR for the OpenShift Vnet. + :vartype vnet_cidr: str + :ivar peer_vnet_id: CIDR of the Vnet to peer. + :vartype peer_vnet_id: str """ _attribute_map = { @@ -73,6 +87,12 @@ def __init__( peer_vnet_id: Optional[str] = None, **kwargs ): + """ + :keyword vnet_cidr: CIDR for the OpenShift Vnet. + :paramtype vnet_cidr: str + :keyword peer_vnet_id: CIDR of the Vnet to peer. + :paramtype peer_vnet_id: str + """ super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.peer_vnet_id = peer_vnet_id @@ -91,10 +111,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -119,6 +139,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -140,34 +166,35 @@ class OpenShiftManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2018_09_30_preview.models.PurchasePlan + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar plan: Define the resource plan as required by ARM for billing purposes. + :vartype plan: ~azure.mgmt.containerservice.v2018_09_30_preview.models.PurchasePlan :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str - :param public_hostname: Optional user-specified FQDN for OpenShift API server. - :type public_hostname: str - :param fqdn: User-specified FQDN for OpenShift API server loadbalancer internal hostname. - :type fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2018_09_30_preview.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: + :ivar open_shift_version: Version of OpenShift specified when creating the cluster. + :vartype open_shift_version: str + :ivar public_hostname: Optional user-specified FQDN for OpenShift API server. + :vartype public_hostname: str + :ivar fqdn: User-specified FQDN for OpenShift API server loadbalancer internal hostname. + :vartype fqdn: str + :ivar network_profile: Configuration for OpenShift networking. + :vartype network_profile: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.NetworkProfile + :ivar router_profiles: Configuration for OpenShift router(s). + :vartype router_profiles: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: + :ivar master_pool_profile: Configuration for OpenShift master VMs. + :vartype master_pool_profile: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Configuration of OpenShift cluster VMs. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: + :ivar auth_profile: Configures OpenShift authentication. + :vartype auth_profile: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterAuthProfile """ @@ -213,6 +240,35 @@ def __init__( auth_profile: Optional["OpenShiftManagedClusterAuthProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword plan: Define the resource plan as required by ARM for billing purposes. + :paramtype plan: ~azure.mgmt.containerservice.v2018_09_30_preview.models.PurchasePlan + :keyword open_shift_version: Version of OpenShift specified when creating the cluster. + :paramtype open_shift_version: str + :keyword public_hostname: Optional user-specified FQDN for OpenShift API server. + :paramtype public_hostname: str + :keyword fqdn: User-specified FQDN for OpenShift API server loadbalancer internal hostname. + :paramtype fqdn: str + :keyword network_profile: Configuration for OpenShift networking. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.NetworkProfile + :keyword router_profiles: Configuration for OpenShift router(s). + :paramtype router_profiles: + list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftRouterProfile] + :keyword master_pool_profile: Configuration for OpenShift master VMs. + :paramtype master_pool_profile: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterMasterPoolProfile + :keyword agent_pool_profiles: Configuration of OpenShift cluster VMs. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterAgentPoolProfile] + :keyword auth_profile: Configures OpenShift authentication. + :paramtype auth_profile: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterAuthProfile + """ super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -234,8 +290,8 @@ class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str """ _validation = { @@ -254,6 +310,8 @@ def __init__( self, **kwargs ): + """ + """ super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) self.kind = None # type: Optional[str] @@ -263,16 +321,16 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str + :ivar client_id: The clientId password associated with the provider. + :vartype client_id: str + :ivar secret: The secret password associated with the provider. + :vartype secret: str + :ivar tenant_id: The tenantId associated with the provider. + :vartype tenant_id: str + :ivar customer_admin_group_id: The groupId to be granted cluster admin role. + :vartype customer_admin_group_id: str """ _validation = { @@ -296,6 +354,16 @@ def __init__( customer_admin_group_id: Optional[str] = None, **kwargs ): + """ + :keyword client_id: The clientId password associated with the provider. + :paramtype client_id: str + :keyword secret: The secret password associated with the provider. + :paramtype secret: str + :keyword tenant_id: The tenantId associated with the provider. + :paramtype tenant_id: str + :keyword customer_admin_group_id: The groupId to be granted cluster admin role. + :paramtype customer_admin_group_id: str + """ super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id @@ -309,12 +377,12 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the pool profile in the context of the subscription and + :ivar name: Required. Unique name of the pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype name: str + :ivar count: Required. Number of agents (VMs) to host docker containers. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -322,16 +390,16 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", + :vartype os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType + :ivar role: Define the role of the AgentPoolProfile. Possible values include: "compute", "infra". - :type role: str or + :vartype role: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftAgentPoolProfileRole """ @@ -361,6 +429,32 @@ def __init__( role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, **kwargs ): + """ + :keyword name: Required. Unique name of the pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of agents (VMs) to host docker containers. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType + :keyword role: Define the role of the AgentPoolProfile. Possible values include: "compute", + "infra". + :paramtype role: str or + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftAgentPoolProfileRole + """ super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -373,8 +467,8 @@ def __init__( class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. - :param identity_providers: Type of authentication profile to use. - :type identity_providers: + :ivar identity_providers: Type of authentication profile to use. + :vartype identity_providers: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterIdentityProvider] """ @@ -388,6 +482,11 @@ def __init__( identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, **kwargs ): + """ + :keyword identity_providers: Type of authentication profile to use. + :paramtype identity_providers: + list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterIdentityProvider] + """ super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers @@ -395,10 +494,10 @@ def __init__( class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): """Defines the configuration of the identity providers to be used in the OpenShift cluster. - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: + :ivar name: Name of the provider. + :vartype name: str + :ivar provider: Configuration of the provider. + :vartype provider: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterBaseIdentityProvider """ @@ -414,6 +513,13 @@ def __init__( provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, **kwargs ): + """ + :keyword name: Name of the provider. + :paramtype name: str + :keyword provider: Configuration of the provider. + :paramtype provider: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterBaseIdentityProvider + """ super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider @@ -424,8 +530,8 @@ class OpenShiftManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of OpenShift managed clusters. - :type value: + :ivar value: The list of OpenShift managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] :ivar next_link: The URL to get the next set of OpenShift managed cluster results. :vartype next_link: str @@ -446,6 +552,11 @@ def __init__( value: Optional[List["OpenShiftManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of OpenShift managed clusters. + :paramtype value: + list[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] + """ super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -456,13 +567,13 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Unique name of the master pool profile in the context of the subscription and + :ivar name: Unique name of the master pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of masters (VMs) to host docker containers. The default value is + :vartype name: str + :ivar count: Required. Number of masters (VMs) to host docker containers. The default value is 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -470,13 +581,13 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType """ _validation = { @@ -502,6 +613,29 @@ def __init__( os_type: Optional[Union[str, "OSType"]] = "Linux", **kwargs ): + """ + :keyword name: Unique name of the master pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of masters (VMs) to host docker containers. The default value + is 3. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2018_09_30_preview.models.OSType + """ super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -515,10 +649,10 @@ class OpenShiftRouterProfile(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Name of the router profile. - :type name: str - :param public_subdomain: DNS subdomain for OpenShift router. - :type public_subdomain: str + :ivar name: Name of the router profile. + :vartype name: str + :ivar public_subdomain: DNS subdomain for OpenShift router. + :vartype public_subdomain: str :ivar fqdn: Auto-allocated FQDN for the OpenShift router. :vartype fqdn: str """ @@ -540,6 +674,12 @@ def __init__( public_subdomain: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the router profile. + :paramtype name: str + :keyword public_subdomain: DNS subdomain for OpenShift router. + :paramtype public_subdomain: str + """ super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = public_subdomain @@ -549,15 +689,15 @@ def __init__( class PurchasePlan(msrest.serialization.Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value + :ivar name: The plan ID. + :vartype name: str + :ivar product: Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str + :vartype product: str + :ivar promotion_code: The promotion code. + :vartype promotion_code: str + :ivar publisher: The plan ID. + :vartype publisher: str """ _attribute_map = { @@ -576,6 +716,17 @@ def __init__( publisher: Optional[str] = None, **kwargs ): + """ + :keyword name: The plan ID. + :paramtype name: str + :keyword product: Specifies the product of the image from the marketplace. This is the same + value as Offer under the imageReference element. + :paramtype product: str + :keyword promotion_code: The promotion code. + :paramtype promotion_code: str + :keyword publisher: The plan ID. + :paramtype publisher: str + """ super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -586,8 +737,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -600,5 +751,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py index 129bd3125edc..4282768925fa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py @@ -5,25 +5,250 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. @@ -47,19 +272,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Gets a list of OpenShift managed clusters in the specified subscription. Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -67,34 +294,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +334,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Lists OpenShift managed clusters in the specified subscription and resource group. Lists OpenShift managed clusters in the specified subscription and resource group. The @@ -131,8 +354,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -140,35 +365,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +407,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": """Gets a OpenShift managed cluster. Gets the details of the managed OpenShift cluster with a specified resource group and name. @@ -216,27 +438,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -250,47 +462,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -308,16 +511,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -329,18 +534,24 @@ def begin_create_or_update( :type resource_name: str :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - :type parameters: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster + :type parameters: + ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -352,27 +563,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -384,47 +589,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-09-30-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -438,16 +633,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @@ -460,15 +657,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2018_09_30_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -480,27 +682,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -512,41 +708,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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 = "2018-09-30-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -559,13 +745,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an OpenShift managed cluster. Deletes the OpenShift managed cluster with a specified resource group and name. @@ -576,15 +763,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -598,21 +787,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -624,4 +806,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py index 39568b66c96e..21deccbc8e9e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_container_service_client.py index a9fe8219bac1..8672ef8cbf01 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_02_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_02_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_02_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_02_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json index b96b9bf7e379..8ca69d3b0d60 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py index 3ecee8107f10..1cbdab5ab21f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_container_service_client.py index 8b7011b35bb6..f80140372e84 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_02_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_02_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_02_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2019_02_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2019_02_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py index d46496ed47c8..eb676c3e5046 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type managed_cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( managed_cluster_name=managed_cluster_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,4 +412,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py index 256fab22c34f..a606ca21ed87 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -455,27 +432,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -489,8 +456,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -503,32 +472,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -546,8 +505,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -568,15 +530,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -588,27 +555,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -620,6 +581,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -634,32 +596,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -673,8 +625,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -694,15 +649,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +674,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +700,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -759,27 +714,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -792,6 +737,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -808,15 +755,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -830,21 +779,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -856,6 +798,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -870,32 +813,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -908,6 +841,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -925,18 +860,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -948,24 +887,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -977,6 +910,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -991,32 +925,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1029,6 +953,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1049,15 +975,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1069,24 +998,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1098,4 +1021,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py index bf7451b63640..74af85aba265 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/__init__.py index c92042d8196f..438187c21681 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/__init__.py @@ -6,66 +6,36 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolListResult - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import ContainerServiceWindowsProfile - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OrchestratorProfile - from ._models_py3 import Resource - from ._models_py3 import SubResource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import ContainerServiceWindowsProfile # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OrchestratorProfile # type: ignore - from ._models import Resource # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolListResult +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import ContainerServiceWindowsProfile +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OrchestratorProfile +from ._models_py3 import Resource +from ._models_py3 import SubResource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_container_service_client_enums.py index 9e903be4cb15..1791a5baa2a6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in PREVIEW. """ @@ -34,7 +19,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -42,7 +27,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -221,7 +206,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -230,21 +215,21 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models.py deleted file mode 100644 index e4ae73f1af93..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models.py +++ /dev/null @@ -1,1404 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'count': {'maximum': 100, 'minimum': 1}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_02_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class ContainerServiceWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, - 'admin_password': {'required': True, 'pattern': r'^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$'}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs['admin_password'] - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_02_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceLinuxProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAddonProfile] - :ivar node_resource_group: Name of the resource group containing agent pool nodes. - :vartype node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile - :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API - server. - :type api_server_authorized_ip_ranges: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'node_resource_group': {'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}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.provisioning_state = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = None - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_authorized_ip_ranges = kwargs.get('api_server_authorized_ip_ranges', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only 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 count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - """ - - _validation = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2019_02_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OrchestratorProfile(msrest.serialization.Model): - """Contains information about orchestrator. - - All required parameters must be populated in order to send to Azure. - - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str - """ - - _validation = { - 'orchestrator_type': {'required': True}, - 'orchestrator_version': {'required': True}, - } - - _attribute_map = { - 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs['orchestrator_type'] - self.orchestrator_version = kwargs['orchestrator_version'] - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models_py3.py index bbcbec92ff65..ed2f6d738f38 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,38 +104,38 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] + :vartype availability_zones: list[str] """ _validation = { @@ -181,6 +183,78 @@ def __init__( availability_zones: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -202,8 +276,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -223,6 +297,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -231,17 +309,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -260,6 +338,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -272,8 +363,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMDiagnostics """ @@ -291,6 +382,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -300,10 +396,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -323,6 +419,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -335,12 +438,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_02_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2019_02_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -378,21 +481,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -421,13 +524,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2019_02_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -442,23 +606,23 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str + :vartype docker_bridge_cidr: str """ _validation = { @@ -488,6 +652,25 @@ def __init__( docker_bridge_cidr: Optional[str] = "172.17.0.1/16", **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2019_02_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -502,9 +685,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshPublicKey] """ @@ -522,6 +705,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -531,9 +720,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -550,6 +739,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -561,8 +755,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -583,6 +777,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -593,10 +791,10 @@ class ContainerServiceWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Windows VMs. - :type admin_username: str - :param admin_password: Required. The administrator password to use for Windows VMs. - :type admin_password: str + :ivar admin_username: Required. The administrator username to use for Windows VMs. + :vartype admin_username: str + :ivar admin_password: Required. The administrator password to use for Windows VMs. + :vartype admin_password: str """ _validation = { @@ -616,6 +814,12 @@ def __init__( admin_password: str, **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Windows VMs. + :paramtype admin_username: str + :keyword admin_password: Required. The administrator password to use for Windows VMs. + :paramtype admin_password: str + """ super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -646,6 +850,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -672,6 +878,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -689,10 +897,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -717,6 +925,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -738,48 +952,47 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceLinuxProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAddonProfile] :ivar node_resource_group: Name of the resource group containing agent pool nodes. :vartype node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile - :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API - server. - :type api_server_authorized_ip_ranges: list[str] + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile + :ivar api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API server. + :vartype api_server_authorized_ip_ranges: list[str] """ _validation = { @@ -832,6 +1045,44 @@ def __init__( api_server_authorized_ip_ranges: Optional[List[str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceLinuxProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAddonProfile] + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile + :keyword api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API + server. + :paramtype api_server_authorized_ip_ranges: list[str] + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.kubernetes_version = kubernetes_version @@ -854,15 +1105,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -886,6 +1137,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -906,12 +1168,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -938,6 +1200,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -947,10 +1217,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -969,6 +1239,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -981,10 +1257,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Required. Number of agents (VMs) to host docker containers. Allowed values must be + in the range of 1 to 100 (inclusive). The default value is 1. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -1022,37 +1298,37 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] + :vartype availability_zones: list[str] """ _validation = { @@ -1095,6 +1371,77 @@ def __init__( availability_zones: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Required. Number of agents (VMs) to host docker containers. Allowed values must + be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1118,10 +1465,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Required. Number of agents (VMs) to host docker containers. Allowed values must be + in the range of 1 to 100 (inclusive). The default value is 1. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -1159,40 +1506,40 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype availability_zones: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1238,6 +1585,80 @@ def __init__( availability_zones: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Required. Number of agents (VMs) to host docker containers. Allowed values must + be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, **kwargs) self.name = name @@ -1247,8 +1668,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1268,6 +1689,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1278,15 +1703,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[str] """ _validation = { @@ -1310,6 +1735,17 @@ def __init__( upgrades: Optional[List[str]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_02_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: list[str] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1322,10 +1758,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1344,6 +1780,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1362,12 +1804,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1394,6 +1836,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1423,6 +1874,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1468,6 +1921,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1482,10 +1937,10 @@ class OrchestratorProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. Orchestrator type. - :type orchestrator_type: str - :param orchestrator_version: Required. Orchestrator version (major, minor, patch). - :type orchestrator_version: str + :ivar orchestrator_type: Required. Orchestrator type. + :vartype orchestrator_type: str + :ivar orchestrator_version: Required. Orchestrator version (major, minor, patch). + :vartype orchestrator_version: str """ _validation = { @@ -1505,6 +1960,12 @@ def __init__( orchestrator_version: str, **kwargs ): + """ + :keyword orchestrator_type: Required. Orchestrator type. + :paramtype orchestrator_type: str + :keyword orchestrator_version: Required. Orchestrator version (major, minor, patch). + :paramtype orchestrator_version: str + """ super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -1513,8 +1974,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1527,5 +1988,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py index 530b6f94679e..e5f7546cb3c2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py @@ -5,25 +5,183 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + managed_cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "managedClusterName": _SERIALIZER.url("managed_cluster_name", managed_cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "managedClusterName": _SERIALIZER.url("managed_cluster_name", managed_cluster_name, 'str'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "managedClusterName": _SERIALIZER.url("managed_cluster_name", managed_cluster_name, 'str'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "managedClusterName": _SERIALIZER.url("managed_cluster_name", managed_cluster_name, 'str'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +205,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - managed_cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + managed_cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +223,8 @@ def list( :type managed_cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +232,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +276,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - managed_cluster_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +310,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +335,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - managed_cluster_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +386,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - managed_cluster_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +413,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +438,21 @@ def begin_create_or_update( managed_cluster_name=managed_cluster_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +464,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - managed_cluster_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +503,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - managed_cluster_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +524,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +549,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,4 +568,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py index b0797abf9f06..9959c36124c0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py @@ -5,25 +5,480 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +502,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +524,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +564,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +584,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +595,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +637,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +669,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +693,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +726,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +751,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +780,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +804,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +833,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +857,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -466,27 +886,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -500,47 +910,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -558,16 +959,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -581,15 +984,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -601,27 +1009,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -633,47 +1035,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -687,16 +1079,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -709,15 +1103,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1128,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,41 +1154,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -808,13 +1191,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -825,15 +1209,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -847,21 +1233,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -873,47 +1252,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -926,14 +1295,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -944,18 +1314,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -967,24 +1341,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -996,47 +1364,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1049,14 +1407,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1070,15 +1429,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1090,24 +1452,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1119,4 +1475,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py index 87ce87af7fd7..f8cb34ebe625 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2019-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py index 838d4fe4a5c3..d7a83a5fc124 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_container_service_client.py index 22aedc7879c6..1ad0638992d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_04_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json index 694625c2ddd5..9aa9efc3f8da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py index 6e83b5c77162..118880be88de 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_container_service_client.py index d5378ac4cf36..d0bd4a282014 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_04_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_04_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_04_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2019_04_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2019_04_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py index b6f289badc9e..10ae21664abb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,4 +412,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py index 270cecf7d033..c787738234a0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -455,27 +432,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -489,8 +456,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -503,32 +472,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -546,8 +505,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -568,15 +530,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -588,27 +555,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -620,6 +581,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -634,32 +596,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -673,8 +625,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -694,15 +649,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +674,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +700,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -759,27 +714,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -792,6 +737,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -808,15 +755,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -830,21 +779,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -856,6 +798,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -870,32 +813,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -908,6 +841,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -925,18 +860,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -948,24 +887,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -977,6 +910,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -991,32 +925,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1029,6 +953,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1049,15 +975,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1069,24 +998,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1098,4 +1021,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py index 88f0e670aba7..00b89978c679 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/__init__.py index 1a2e8eac6703..c690fe9d4ec5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/__init__.py @@ -6,68 +6,37 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolListResult - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import SubResource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolListResult +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import SubResource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_container_service_client_enums.py index 02e7ae312cdb..f6c3f83be327 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in PREVIEW. """ @@ -34,7 +19,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -42,7 +27,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -221,7 +206,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -230,35 +215,35 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models.py deleted file mode 100644 index df83703d36e8..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models.py +++ /dev/null @@ -1,1466 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'count': {'maximum': 100, 'minimum': 1}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_04_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_04_01.models.LoadBalancerSku - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_04_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile - :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API - server. - :type api_server_authorized_ip_ranges: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_authorized_ip_ranges = kwargs.get('api_server_authorized_ip_ranges', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only 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 count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - """ - - _validation = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_04_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2019_04_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py index 169658545b0e..42ce0f45c59b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,38 +104,38 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] + :vartype availability_zones: list[str] """ _validation = { @@ -181,6 +183,78 @@ def __init__( availability_zones: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -202,8 +276,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -223,6 +297,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -231,17 +309,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody] """ _attribute_map = { @@ -260,6 +338,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -272,8 +363,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMDiagnostics """ @@ -291,6 +382,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -300,10 +396,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -323,6 +419,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -335,12 +438,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_04_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2019_04_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -378,21 +481,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -421,13 +524,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2019_04_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -442,26 +606,27 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype docker_bridge_cidr: str + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_04_01.models.LoadBalancerSku + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_04_01.models.LoadBalancerSku """ _validation = { @@ -493,6 +658,29 @@ def __init__( load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2019_04_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_04_01.models.LoadBalancerSku + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -508,9 +696,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshPublicKey] """ @@ -528,6 +716,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -537,9 +731,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -556,6 +750,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -567,8 +766,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -589,6 +788,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -619,6 +822,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -645,6 +850,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -662,10 +869,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -690,6 +897,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -711,55 +924,54 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile - :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API - server. - :type api_server_authorized_ip_ranges: list[str] + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile + :ivar api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API server. + :vartype api_server_authorized_ip_ranges: list[str] """ _validation = { @@ -818,6 +1030,51 @@ def __init__( api_server_authorized_ip_ranges: Optional[List[str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile + :keyword api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API + server. + :paramtype api_server_authorized_ip_ranges: list[str] + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -843,15 +1100,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -875,6 +1132,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -895,12 +1163,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -927,6 +1195,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -936,10 +1212,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -958,6 +1234,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -970,10 +1252,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Required. Number of agents (VMs) to host docker containers. Allowed values must be + in the range of 1 to 100 (inclusive). The default value is 1. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -1011,37 +1293,37 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] + :vartype availability_zones: list[str] """ _validation = { @@ -1084,6 +1366,77 @@ def __init__( availability_zones: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Required. Number of agents (VMs) to host docker containers. Allowed values must + be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1107,10 +1460,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Required. Number of agents (VMs) to host docker containers. Allowed values must - be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Required. Number of agents (VMs) to host docker containers. Allowed values must be + in the range of 1 to 100 (inclusive). The default value is 1. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -1148,40 +1501,40 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype availability_zones: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1227,6 +1580,80 @@ def __init__( availability_zones: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Required. Number of agents (VMs) to host docker containers. Allowed values must + be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, **kwargs) self.name = name @@ -1242,11 +1669,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_04_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2019_04_01.models.ResourceIdentityType """ _validation = { @@ -1266,6 +1693,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_04_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1277,8 +1712,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1298,6 +1733,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1308,15 +1747,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1341,6 +1780,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_04_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1351,10 +1802,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1369,6 +1820,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1379,10 +1836,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1401,6 +1858,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1419,12 +1882,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1451,6 +1914,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1464,22 +1936,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -1498,6 +1970,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -1524,6 +2014,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1569,6 +2061,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1581,8 +2075,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1595,5 +2089,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py index 726d0444d0b1..0bd44d7bacf8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py @@ -5,25 +5,183 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +205,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +223,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +232,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +276,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +310,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +335,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +386,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +413,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +438,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +464,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +503,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +524,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +549,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,4 +568,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py index 31e63da00d3e..6ac3fe920e01 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py @@ -5,25 +5,480 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +502,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +524,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +564,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +584,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +595,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +637,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +669,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +693,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +726,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +751,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +780,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +804,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +833,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +857,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -466,27 +886,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -500,47 +910,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -558,16 +959,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -581,15 +984,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -601,27 +1009,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -633,47 +1035,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -687,16 +1079,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -709,15 +1103,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1128,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,41 +1154,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -808,13 +1191,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -825,15 +1209,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -847,21 +1233,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -873,47 +1252,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -926,14 +1295,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -944,18 +1314,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -967,24 +1341,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -996,47 +1364,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1049,14 +1407,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1070,15 +1429,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1090,24 +1452,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1119,4 +1475,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py index 5019cf30003f..d982afdeec90 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py index e3955647eb73..a0a3dc4a5cca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_container_service_client.py index 2576124f89b4..34a1f6623e2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_container_service_client.py @@ -6,74 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse 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 . import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from . import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_04_30.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2019_04_30.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json index c0083791de27..556230d5c23a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py index bbfc8adba6c3..317de0977bc7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_container_service_client.py index 3a448d559036..9742904cb515 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_container_service_client.py @@ -6,70 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest 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 .. import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_04_30.aio.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2019_04_30.aio.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py index 4c4c1284a4fe..75bf3a135d30 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._open_shift_managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -209,27 +214,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -243,8 +238,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -257,32 +254,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -300,8 +287,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -323,15 +313,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -343,27 +338,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -375,6 +364,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -389,32 +379,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -428,8 +408,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -449,15 +432,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_04_30.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -469,27 +457,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -501,6 +483,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -514,27 +497,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -547,6 +520,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -563,15 +538,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -585,21 +562,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -611,4 +581,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py index 68a09f6ce11d..35292467d6d1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py @@ -6,36 +6,21 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import CloudErrorBody - from ._models_py3 import NetworkProfile - from ._models_py3 import OpenShiftManagedCluster - from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider - from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile - from ._models_py3 import OpenShiftManagedClusterAuthProfile - from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider - from ._models_py3 import OpenShiftManagedClusterIdentityProvider - from ._models_py3 import OpenShiftManagedClusterListResult - from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile - from ._models_py3 import OpenShiftRouterProfile - from ._models_py3 import PurchasePlan - from ._models_py3 import Resource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import CloudErrorBody # type: ignore - from ._models import NetworkProfile # type: ignore - from ._models import OpenShiftManagedCluster # type: ignore - from ._models import OpenShiftManagedClusterAADIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterAgentPoolProfile # type: ignore - from ._models import OpenShiftManagedClusterAuthProfile # type: ignore - from ._models import OpenShiftManagedClusterBaseIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterListResult # type: ignore - from ._models import OpenShiftManagedClusterMasterPoolProfile # type: ignore - from ._models import OpenShiftRouterProfile # type: ignore - from ._models import PurchasePlan # type: ignore - from ._models import Resource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import CloudErrorBody +from ._models_py3 import NetworkProfile +from ._models_py3 import OpenShiftManagedCluster +from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider +from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile +from ._models_py3 import OpenShiftManagedClusterAuthProfile +from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider +from ._models_py3 import OpenShiftManagedClusterIdentityProvider +from ._models_py3 import OpenShiftManagedClusterListResult +from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile +from ._models_py3 import OpenShiftRouterProfile +from ._models_py3 import PurchasePlan +from ._models_py3 import Resource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( OSType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_container_service_client_enums.py index 05a77b92092e..9cff02877c35 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftAgentPoolProfileRole(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. """ COMPUTE = "compute" INFRA = "infra" -class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftContainerServiceVMSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of OpenShift VMs. """ @@ -71,7 +56,7 @@ class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, s STANDARD_L16_S = "Standard_L16s" STANDARD_L32_S = "Standard_L32s" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models.py deleted file mode 100644 index 667208918b44..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models.py +++ /dev/null @@ -1,553 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class NetworkProfile(msrest.serialization.Model): - """Represents the OpenShift networking configuration. - - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param peer_vnet_id: CIDR of the Vnet to peer. - :type peer_vnet_id: str - :param vnet_id: ID of the Vnet created for OSA cluster. - :type vnet_id: str - """ - - _attribute_map = { - 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, - 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, - 'vnet_id': {'key': 'vnetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkProfile, self).__init__(**kwargs) - self.vnet_cidr = kwargs.get('vnet_cidr', "10.0.0.0/8") - self.peer_vnet_id = kwargs.get('peer_vnet_id', None) - self.vnet_id = kwargs.get('vnet_id', None) - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class OpenShiftManagedCluster(Resource): - """OpenShift Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2019_04_30.models.PurchasePlan - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str - :ivar cluster_version: Version of OpenShift specified when creating the cluster. - :vartype cluster_version: str - :ivar public_hostname: Service generated FQDN for OpenShift API server. - :vartype public_hostname: str - :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer internal hostname. - :vartype fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2019_04_30.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: - list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterAuthProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'cluster_version': {'readonly': True}, - 'public_hostname': {'readonly': True}, - 'fqdn': {'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}'}, - 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'open_shift_version': {'key': 'properties.openShiftVersion', 'type': 'str'}, - 'cluster_version': {'key': 'properties.clusterVersion', 'type': 'str'}, - 'public_hostname': {'key': 'properties.publicHostname', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, - 'router_profiles': {'key': 'properties.routerProfiles', 'type': '[OpenShiftRouterProfile]'}, - 'master_pool_profile': {'key': 'properties.masterPoolProfile', 'type': 'OpenShiftManagedClusterMasterPoolProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[OpenShiftManagedClusterAgentPoolProfile]'}, - 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedCluster, self).__init__(**kwargs) - self.plan = kwargs.get('plan', None) - self.provisioning_state = None - self.open_shift_version = kwargs.get('open_shift_version', None) - self.cluster_version = None - self.public_hostname = None - self.fqdn = None - self.network_profile = kwargs.get('network_profile', None) - self.router_profiles = kwargs.get('router_profiles', None) - self.master_pool_profile = kwargs.get('master_pool_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.auth_profile = kwargs.get('auth_profile', None) - - -class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): - """Structure for any Identity provider. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: OpenShiftManagedClusterAADIdentityProvider. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None # type: Optional[str] - - -class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): - """Defines the Identity provider for MS AAD. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) - self.kind = 'AADIdentityProvider' # type: str - self.client_id = kwargs.get('client_id', None) - self.secret = kwargs.get('secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.customer_admin_group_id = kwargs.get('customer_admin_group_id', None) - - -class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): - """Defines the configuration of the OpenShift cluster VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Unique name of the pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", - "infra". - :type role: str or - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftAgentPoolProfileRole - """ - - _validation = { - 'name': {'required': True}, - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', "10.0.0.0/24") - self.os_type = kwargs.get('os_type', "Linux") - self.role = kwargs.get('role', None) - - -class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): - """Defines all possible authentication profiles for the OpenShift cluster. - - :param identity_providers: Type of authentication profile to use. - :type identity_providers: - list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterIdentityProvider] - """ - - _attribute_map = { - 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) - self.identity_providers = kwargs.get('identity_providers', None) - - -class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): - """Defines the configuration of the identity providers to be used in the OpenShift cluster. - - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterBaseIdentityProvider - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.provider = kwargs.get('provider', None) - - -class OpenShiftManagedClusterListResult(msrest.serialization.Model): - """The response from the List OpenShift Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of OpenShift managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :ivar next_link: The URL to get the next set of OpenShift managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OpenShiftManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Unique name of the master pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of masters (VMs) to host docker containers. The default value is - 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType - """ - - _validation = { - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', None) - self.os_type = kwargs.get('os_type', "Linux") - - -class OpenShiftRouterProfile(msrest.serialization.Model): - """Represents an OpenShift router. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Name of the router profile. - :type name: str - :ivar public_subdomain: DNS subdomain for OpenShift router. - :vartype public_subdomain: str - :ivar fqdn: Auto-allocated FQDN for the OpenShift router. - :vartype fqdn: str - """ - - _validation = { - 'public_subdomain': {'readonly': True}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'public_subdomain': {'key': 'publicSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftRouterProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.public_subdomain = None - self.fqdn = None - - -class PurchasePlan(msrest.serialization.Model): - """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value - as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PurchasePlan, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.product = kwargs.get('product', None) - self.promotion_code = kwargs.get('promotion_code', None) - self.publisher = kwargs.get('publisher', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models_py3.py index dc31d6dfd597..11b32dca9a0f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_models_py3.py @@ -16,17 +16,17 @@ class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody] """ _attribute_map = { @@ -45,6 +45,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -55,12 +68,12 @@ def __init__( class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param peer_vnet_id: CIDR of the Vnet to peer. - :type peer_vnet_id: str - :param vnet_id: ID of the Vnet created for OSA cluster. - :type vnet_id: str + :ivar vnet_cidr: CIDR for the OpenShift Vnet. + :vartype vnet_cidr: str + :ivar peer_vnet_id: CIDR of the Vnet to peer. + :vartype peer_vnet_id: str + :ivar vnet_id: ID of the Vnet created for OSA cluster. + :vartype vnet_id: str """ _attribute_map = { @@ -77,6 +90,14 @@ def __init__( vnet_id: Optional[str] = None, **kwargs ): + """ + :keyword vnet_cidr: CIDR for the OpenShift Vnet. + :paramtype vnet_cidr: str + :keyword peer_vnet_id: CIDR of the Vnet to peer. + :paramtype peer_vnet_id: str + :keyword vnet_id: ID of the Vnet created for OSA cluster. + :paramtype vnet_id: str + """ super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.peer_vnet_id = peer_vnet_id @@ -96,10 +117,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -124,6 +145,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -145,36 +172,36 @@ class OpenShiftManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2019_04_30.models.PurchasePlan + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar plan: Define the resource plan as required by ARM for billing purposes. + :vartype plan: ~azure.mgmt.containerservice.v2019_04_30.models.PurchasePlan :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str + :ivar open_shift_version: Version of OpenShift specified when creating the cluster. + :vartype open_shift_version: str :ivar cluster_version: Version of OpenShift specified when creating the cluster. :vartype cluster_version: str :ivar public_hostname: Service generated FQDN for OpenShift API server. :vartype public_hostname: str :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer internal hostname. :vartype fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2019_04_30.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: + :ivar network_profile: Configuration for OpenShift networking. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_04_30.models.NetworkProfile + :ivar router_profiles: Configuration for OpenShift router(s). + :vartype router_profiles: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: + :ivar master_pool_profile: Configuration for OpenShift master VMs. + :vartype master_pool_profile: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Configuration of OpenShift cluster VMs. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: + :ivar auth_profile: Configures OpenShift authentication. + :vartype auth_profile: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterAuthProfile """ @@ -222,6 +249,30 @@ def __init__( auth_profile: Optional["OpenShiftManagedClusterAuthProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword plan: Define the resource plan as required by ARM for billing purposes. + :paramtype plan: ~azure.mgmt.containerservice.v2019_04_30.models.PurchasePlan + :keyword open_shift_version: Version of OpenShift specified when creating the cluster. + :paramtype open_shift_version: str + :keyword network_profile: Configuration for OpenShift networking. + :paramtype network_profile: ~azure.mgmt.containerservice.v2019_04_30.models.NetworkProfile + :keyword router_profiles: Configuration for OpenShift router(s). + :paramtype router_profiles: + list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftRouterProfile] + :keyword master_pool_profile: Configuration for OpenShift master VMs. + :paramtype master_pool_profile: + ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterMasterPoolProfile + :keyword agent_pool_profiles: Configuration of OpenShift cluster VMs. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterAgentPoolProfile] + :keyword auth_profile: Configures OpenShift authentication. + :paramtype auth_profile: + ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterAuthProfile + """ super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -244,8 +295,8 @@ class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str """ _validation = { @@ -264,6 +315,8 @@ def __init__( self, **kwargs ): + """ + """ super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) self.kind = None # type: Optional[str] @@ -273,16 +326,16 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str + :ivar client_id: The clientId password associated with the provider. + :vartype client_id: str + :ivar secret: The secret password associated with the provider. + :vartype secret: str + :ivar tenant_id: The tenantId associated with the provider. + :vartype tenant_id: str + :ivar customer_admin_group_id: The groupId to be granted cluster admin role. + :vartype customer_admin_group_id: str """ _validation = { @@ -306,6 +359,16 @@ def __init__( customer_admin_group_id: Optional[str] = None, **kwargs ): + """ + :keyword client_id: The clientId password associated with the provider. + :paramtype client_id: str + :keyword secret: The secret password associated with the provider. + :paramtype secret: str + :keyword tenant_id: The tenantId associated with the provider. + :paramtype tenant_id: str + :keyword customer_admin_group_id: The groupId to be granted cluster admin role. + :paramtype customer_admin_group_id: str + """ super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id @@ -319,12 +382,12 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the pool profile in the context of the subscription and + :ivar name: Required. Unique name of the pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype name: str + :ivar count: Required. Number of agents (VMs) to host docker containers. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -332,16 +395,16 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType + :ivar role: Define the role of the AgentPoolProfile. Possible values include: "compute", "infra". - :type role: str or + :vartype role: str or ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftAgentPoolProfileRole """ @@ -371,6 +434,32 @@ def __init__( role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, **kwargs ): + """ + :keyword name: Required. Unique name of the pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of agents (VMs) to host docker containers. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType + :keyword role: Define the role of the AgentPoolProfile. Possible values include: "compute", + "infra". + :paramtype role: str or + ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftAgentPoolProfileRole + """ super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -383,8 +472,8 @@ def __init__( class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. - :param identity_providers: Type of authentication profile to use. - :type identity_providers: + :ivar identity_providers: Type of authentication profile to use. + :vartype identity_providers: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterIdentityProvider] """ @@ -398,6 +487,11 @@ def __init__( identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, **kwargs ): + """ + :keyword identity_providers: Type of authentication profile to use. + :paramtype identity_providers: + list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterIdentityProvider] + """ super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers @@ -405,10 +499,10 @@ def __init__( class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): """Defines the configuration of the identity providers to be used in the OpenShift cluster. - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: + :ivar name: Name of the provider. + :vartype name: str + :ivar provider: Configuration of the provider. + :vartype provider: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterBaseIdentityProvider """ @@ -424,6 +518,13 @@ def __init__( provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, **kwargs ): + """ + :keyword name: Name of the provider. + :paramtype name: str + :keyword provider: Configuration of the provider. + :paramtype provider: + ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterBaseIdentityProvider + """ super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider @@ -434,8 +535,8 @@ class OpenShiftManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of OpenShift managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] + :ivar value: The list of OpenShift managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] :ivar next_link: The URL to get the next set of OpenShift managed cluster results. :vartype next_link: str """ @@ -455,6 +556,10 @@ def __init__( value: Optional[List["OpenShiftManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of OpenShift managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] + """ super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -465,13 +570,13 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Unique name of the master pool profile in the context of the subscription and + :ivar name: Unique name of the master pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of masters (VMs) to host docker containers. The default value is + :vartype name: str + :ivar count: Required. Number of masters (VMs) to host docker containers. The default value is 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -479,13 +584,13 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType """ _validation = { @@ -511,6 +616,29 @@ def __init__( os_type: Optional[Union[str, "OSType"]] = "Linux", **kwargs ): + """ + :keyword name: Unique name of the master pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of masters (VMs) to host docker containers. The default value + is 3. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_04_30.models.OSType + """ super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -524,8 +652,8 @@ class OpenShiftRouterProfile(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Name of the router profile. - :type name: str + :ivar name: Name of the router profile. + :vartype name: str :ivar public_subdomain: DNS subdomain for OpenShift router. :vartype public_subdomain: str :ivar fqdn: Auto-allocated FQDN for the OpenShift router. @@ -549,6 +677,10 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the router profile. + :paramtype name: str + """ super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = None @@ -558,15 +690,15 @@ def __init__( class PurchasePlan(msrest.serialization.Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value + :ivar name: The plan ID. + :vartype name: str + :ivar product: Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str + :vartype product: str + :ivar promotion_code: The promotion code. + :vartype promotion_code: str + :ivar publisher: The plan ID. + :vartype publisher: str """ _attribute_map = { @@ -585,6 +717,17 @@ def __init__( publisher: Optional[str] = None, **kwargs ): + """ + :keyword name: The plan ID. + :paramtype name: str + :keyword product: Specifies the product of the image from the marketplace. This is the same + value as Offer under the imageReference element. + :paramtype product: str + :keyword promotion_code: The promotion code. + :paramtype promotion_code: str + :keyword publisher: The plan ID. + :paramtype publisher: str + """ super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -595,8 +738,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -609,5 +752,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py index 3f57b1488dfa..e34cf175909d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py @@ -5,25 +5,250 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-04-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-04-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. @@ -47,19 +272,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Gets a list of OpenShift managed clusters in the specified subscription. Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -67,34 +294,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +334,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Lists OpenShift managed clusters in the specified subscription and resource group. Lists OpenShift managed clusters in the specified subscription and resource group. The @@ -131,8 +354,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -140,35 +365,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +407,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": """Gets a OpenShift managed cluster. Gets the details of the managed OpenShift cluster with a specified resource group and name. @@ -216,27 +438,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -250,47 +462,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -308,16 +511,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -332,15 +537,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -352,27 +562,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -384,47 +588,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -438,16 +632,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @@ -460,15 +656,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_04_30.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -480,27 +681,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -512,41 +707,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-04-30" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -559,13 +744,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an OpenShift managed cluster. Deletes the OpenShift managed cluster with a specified resource group and name. @@ -576,15 +762,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -598,21 +786,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -624,4 +805,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py index 28442efd1478..e88e09d237d9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_container_service_client.py index 0fb733300978..427c9ab4e6fa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_06_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_06_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_06_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_06_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json index 530774a9ce99..a916919d2376 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py index a93e9ab153d1..32ba6a58a55a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_container_service_client.py index 1ae64bd86d6d..1534f0dee4e3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_06_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_06_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_06_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2019_06_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2019_06_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py index e8d330c85f49..6808409cf503 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py index 8dcc047d0b87..f6b077f5108c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -455,27 +432,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -489,8 +456,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -503,32 +472,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -546,8 +505,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -568,15 +530,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -588,27 +555,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -620,6 +581,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -634,32 +596,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -673,8 +625,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -694,15 +649,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +674,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +700,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -759,27 +714,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -792,6 +737,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -808,15 +755,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -830,21 +779,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -856,6 +798,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -870,32 +813,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -908,6 +841,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -925,18 +860,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -948,24 +887,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -977,6 +910,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -991,32 +925,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1029,6 +953,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1049,15 +975,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1069,24 +998,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1098,4 +1021,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py index 10c9632ba710..9dbf8b35c3ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/__init__.py index 36528dbf044b..8e3cc7d17959 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/__init__.py @@ -6,76 +6,41 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import SubResource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import SubResource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_container_service_client_enums.py index b481cccbda24..18f038fe5f80 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in PREVIEW. """ @@ -34,7 +19,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -42,7 +27,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -221,7 +206,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -230,35 +215,35 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -268,7 +253,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. """ @@ -276,7 +261,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models.py deleted file mode 100644 index dca12d03bc63..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models.py +++ /dev/null @@ -1,1667 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_06_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_06_01.models.LoadBalancerSku - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_06_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile - :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API - server. - :type api_server_authorized_ip_ranges: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_authorized_ip_ranges = kwargs.get('api_server_authorized_ip_ranges', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_06_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2019_06_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py index f913dba7cf93..9f01e52b14f4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,53 +104,53 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -203,6 +205,93 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -234,8 +323,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -258,6 +347,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -268,12 +362,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -290,6 +384,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -301,8 +403,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -322,6 +424,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -340,13 +446,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -375,6 +481,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -387,10 +503,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -405,6 +521,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -413,17 +535,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody] """ _attribute_map = { @@ -442,6 +564,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -454,8 +589,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMDiagnostics """ @@ -473,6 +608,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -482,10 +622,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -505,6 +645,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -517,12 +664,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_06_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2019_06_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -560,21 +707,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -603,13 +750,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2019_06_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -624,26 +832,27 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype docker_bridge_cidr: str + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_06_01.models.LoadBalancerSku + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_06_01.models.LoadBalancerSku """ _validation = { @@ -675,6 +884,29 @@ def __init__( load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_06_01.models.LoadBalancerSku + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -690,9 +922,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshPublicKey] """ @@ -710,6 +942,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -719,9 +957,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -738,6 +976,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -749,8 +992,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -771,6 +1014,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -801,6 +1048,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -827,6 +1076,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -844,10 +1095,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -872,6 +1123,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -893,55 +1150,54 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile - :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API - server. - :type api_server_authorized_ip_ranges: list[str] + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile + :ivar api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API server. + :vartype api_server_authorized_ip_ranges: list[str] """ _validation = { @@ -1000,6 +1256,51 @@ def __init__( api_server_authorized_ip_ranges: Optional[List[str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile + :keyword api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API + server. + :paramtype api_server_authorized_ip_ranges: list[str] + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -1025,15 +1326,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -1057,6 +1358,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1077,12 +1389,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1109,6 +1421,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1118,10 +1438,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -1140,6 +1460,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1150,10 +1476,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1191,52 +1517,52 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1285,6 +1611,92 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1312,10 +1724,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1353,55 +1765,55 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1453,6 +1865,95 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_06_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, node_taints=node_taints, **kwargs) self.name = name @@ -1468,11 +1969,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_06_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2019_06_01.models.ResourceIdentityType """ _validation = { @@ -1492,6 +1993,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_06_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1503,8 +2012,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1524,6 +2033,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1534,15 +2047,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1567,6 +2080,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_06_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1577,10 +2102,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1595,6 +2120,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1605,10 +2136,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1627,6 +2158,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1645,12 +2182,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1677,6 +2214,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1690,22 +2236,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -1724,6 +2270,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -1750,6 +2314,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1795,6 +2361,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1807,8 +2375,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1821,5 +2389,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py index 40ec7a9456c6..824363aaac71 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py index 8b63f1c8e75e..8f82eae87686 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py @@ -5,25 +5,480 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +502,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +524,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +564,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +584,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +595,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +637,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +669,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +693,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +726,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +751,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +780,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +804,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +833,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +857,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -466,27 +886,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -500,47 +910,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -558,16 +959,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -581,15 +984,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -601,27 +1009,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -633,47 +1035,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -687,16 +1079,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -709,15 +1103,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1128,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,41 +1154,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -808,13 +1191,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -825,15 +1209,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -847,21 +1233,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -873,47 +1252,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -926,14 +1295,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -944,18 +1314,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -967,24 +1341,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -996,47 +1364,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1049,14 +1407,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1070,15 +1429,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1090,24 +1452,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1119,4 +1475,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py index afa1ed31c8a7..f8f3f70c432b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2019-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-06-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py index 1cbb309f1ab7..b6c597d7c770 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_container_service_client.py index 4ec0537531d2..5788af48609f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_08_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_08_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_08_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_08_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json index 1fa565fb2b00..ee6bdb3ca80a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py index e2041e496021..6218f4a71780 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_container_service_client.py index bd3e68d0725c..702c0e132478 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_08_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_08_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_08_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2019_08_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2019_08_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py index ea719c3e7333..ab43861e590a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py index 56d3e4411362..c62b4f60d866 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -455,27 +432,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -489,8 +456,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -503,32 +472,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -546,8 +505,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -568,15 +530,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -588,27 +555,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -620,6 +581,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -634,32 +596,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -673,8 +625,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -694,15 +649,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +674,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +700,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -759,27 +714,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -792,6 +737,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -808,15 +755,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -830,21 +779,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -856,6 +798,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -870,32 +813,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -908,6 +841,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -925,18 +860,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -948,24 +887,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -977,6 +910,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -991,32 +925,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1029,6 +953,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1049,15 +975,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1069,24 +998,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1098,6 +1021,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1111,27 +1035,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1144,6 +1058,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1160,15 +1076,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1182,21 +1100,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1208,4 +1119,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py index 13937ec4f230..fe7cdf0c2b67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/__init__.py index 90e3057ac05e..2988c4a54d06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/__init__.py @@ -6,88 +6,47 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_container_service_client_enums.py index b481cccbda24..18f038fe5f80 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in PREVIEW. """ @@ -34,7 +19,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -42,7 +27,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -221,7 +206,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -230,35 +215,35 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -268,7 +253,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. """ @@ -276,7 +261,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models.py deleted file mode 100644 index a950018c9bc8..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models.py +++ /dev/null @@ -1,1814 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_08_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_08_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_08_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAPIServerAccessProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_08_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] - """ - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2019_08_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py index e22734d7fb65..33b79a3f7e1e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,53 +104,53 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -203,6 +205,93 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -234,8 +323,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -258,6 +347,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -268,12 +362,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -290,6 +384,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -301,8 +403,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -322,6 +424,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -340,13 +446,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -375,6 +481,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -387,10 +503,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -405,6 +521,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -413,17 +535,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody] """ _attribute_map = { @@ -442,6 +564,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -454,8 +589,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMDiagnostics """ @@ -473,6 +608,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -482,10 +622,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -505,6 +645,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -517,12 +664,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_08_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2019_08_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -560,21 +707,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -603,13 +750,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2019_08_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -624,28 +832,29 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype docker_bridge_cidr: str + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_08_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_08_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfile """ @@ -680,6 +889,32 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_08_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -696,9 +931,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshPublicKey] """ @@ -716,6 +951,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -725,9 +966,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -744,6 +985,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -755,8 +1001,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -777,6 +1023,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -807,6 +1057,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -833,6 +1085,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -850,10 +1104,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -878,6 +1132,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -899,54 +1159,54 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAPIServerAccessProfile """ @@ -1006,6 +1266,51 @@ def __init__( api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAPIServerAccessProfile + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -1031,15 +1336,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -1063,6 +1368,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1083,12 +1399,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1115,6 +1431,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1124,10 +1448,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -1146,6 +1470,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1156,10 +1486,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1197,52 +1527,52 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1291,6 +1621,92 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1318,10 +1734,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1359,55 +1775,55 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1459,6 +1875,95 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_08_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, node_taints=node_taints, **kwargs) self.name = name @@ -1466,10 +1971,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1484,6 +1989,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1500,11 +2011,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_08_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2019_08_01.models.ResourceIdentityType """ _validation = { @@ -1524,6 +2035,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_08_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1535,8 +2054,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1556,6 +2075,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1564,19 +2087,18 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] """ @@ -1596,6 +2118,22 @@ def __init__( effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -1606,9 +2144,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -1625,6 +2163,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -1632,8 +2175,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] """ @@ -1647,6 +2190,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -1654,8 +2202,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] """ _attribute_map = { @@ -1668,6 +2216,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -1677,15 +2229,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1710,6 +2262,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_08_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1720,10 +2284,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1738,6 +2302,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1748,10 +2318,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1770,6 +2340,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1788,12 +2364,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1820,6 +2396,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1833,22 +2418,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -1867,6 +2452,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -1893,6 +2496,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1938,6 +2543,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1950,8 +2557,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -1964,6 +2571,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -1971,8 +2582,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1985,5 +2596,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py index b3a097f9471f..76f63842dd8d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py index a18598a8f0e3..6d92acf3210b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py @@ -5,25 +5,515 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +537,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +559,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +599,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +619,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +630,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +672,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +704,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +728,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +761,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +786,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +815,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +839,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +868,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +892,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -466,27 +921,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -500,47 +945,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -558,16 +994,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -581,15 +1019,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -601,27 +1044,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -633,47 +1070,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -687,16 +1114,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -709,15 +1138,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1163,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,41 +1189,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -808,13 +1226,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -825,15 +1244,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -847,21 +1268,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -873,47 +1287,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -926,14 +1330,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -944,18 +1349,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -967,24 +1376,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -996,47 +1399,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1049,14 +1442,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1070,15 +1464,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1090,24 +1487,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1119,41 +1510,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1166,13 +1547,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1183,15 +1565,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1205,21 +1589,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1231,4 +1608,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py index 1d4ce9496c10..cb8287b3cb4d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2019-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py index 8e23d77fb5c5..f7d4c661acd4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py index 42b38932f4d5..0ad687309502 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_container_service_client.py @@ -6,74 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse 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 . import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from . import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_09_30_preview.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2019_09_30_preview.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json index 7913ed486272..fa7dcb5546a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py index 42b340447590..44b8afee81ff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py index 0ef568975f85..744b67ef7ef8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py @@ -6,70 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest 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 .. import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_09_30_preview.aio.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2019_09_30_preview.aio.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py index 93c5bc900c0e..73c4c87090e3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._open_shift_managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -209,27 +214,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -243,8 +238,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -257,32 +254,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -300,8 +287,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -320,18 +310,24 @@ async def begin_create_or_update( :type resource_name: str :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - :type parameters: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster + :type parameters: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -343,27 +339,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -375,6 +365,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -389,32 +380,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -428,8 +409,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -449,15 +433,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_09_30_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -469,27 +458,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -501,6 +484,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -514,27 +498,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -547,6 +521,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -563,15 +539,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -585,21 +563,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -611,4 +582,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/__init__.py index 157115a6924d..8c10ceed1560 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/__init__.py @@ -6,38 +6,22 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import CloudErrorBody - from ._models_py3 import NetworkProfile - from ._models_py3 import OpenShiftManagedCluster - from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider - from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile - from ._models_py3 import OpenShiftManagedClusterAuthProfile - from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider - from ._models_py3 import OpenShiftManagedClusterIdentityProvider - from ._models_py3 import OpenShiftManagedClusterListResult - from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile - from ._models_py3 import OpenShiftManagedClusterMonitorProfile - from ._models_py3 import OpenShiftRouterProfile - from ._models_py3 import PurchasePlan - from ._models_py3 import Resource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import CloudErrorBody # type: ignore - from ._models import NetworkProfile # type: ignore - from ._models import OpenShiftManagedCluster # type: ignore - from ._models import OpenShiftManagedClusterAADIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterAgentPoolProfile # type: ignore - from ._models import OpenShiftManagedClusterAuthProfile # type: ignore - from ._models import OpenShiftManagedClusterBaseIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterListResult # type: ignore - from ._models import OpenShiftManagedClusterMasterPoolProfile # type: ignore - from ._models import OpenShiftManagedClusterMonitorProfile # type: ignore - from ._models import OpenShiftRouterProfile # type: ignore - from ._models import PurchasePlan # type: ignore - from ._models import Resource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import CloudErrorBody +from ._models_py3 import NetworkProfile +from ._models_py3 import OpenShiftManagedCluster +from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider +from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile +from ._models_py3 import OpenShiftManagedClusterAuthProfile +from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider +from ._models_py3 import OpenShiftManagedClusterIdentityProvider +from ._models_py3 import OpenShiftManagedClusterListResult +from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile +from ._models_py3 import OpenShiftManagedClusterMonitorProfile +from ._models_py3 import OpenShiftRouterProfile +from ._models_py3 import PurchasePlan +from ._models_py3 import Resource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( OSType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_container_service_client_enums.py index 05a77b92092e..9cff02877c35 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftAgentPoolProfileRole(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. """ COMPUTE = "compute" INFRA = "infra" -class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftContainerServiceVMSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of OpenShift VMs. """ @@ -71,7 +56,7 @@ class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, s STANDARD_L16_S = "Standard_L16s" STANDARD_L32_S = "Standard_L32s" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models.py deleted file mode 100644 index 5b674597c622..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models.py +++ /dev/null @@ -1,583 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class NetworkProfile(msrest.serialization.Model): - """Represents the OpenShift networking configuration. - - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param peer_vnet_id: CIDR of the Vnet to peer. - :type peer_vnet_id: str - :param vnet_id: ID of the Vnet created for OSA cluster. - :type vnet_id: str - """ - - _attribute_map = { - 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, - 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, - 'vnet_id': {'key': 'vnetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkProfile, self).__init__(**kwargs) - self.vnet_cidr = kwargs.get('vnet_cidr', "10.0.0.0/8") - self.peer_vnet_id = kwargs.get('peer_vnet_id', None) - self.vnet_id = kwargs.get('vnet_id', None) - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class OpenShiftManagedCluster(Resource): - """OpenShift Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2019_09_30_preview.models.PurchasePlan - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str - :ivar cluster_version: Version of OpenShift specified when creating the cluster. - :vartype cluster_version: str - :ivar public_hostname: Service generated FQDN for OpenShift API server. - :vartype public_hostname: str - :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer internal hostname. - :vartype fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2019_09_30_preview.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: - list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterAuthProfile - :param monitor_profile: Configures Log Analytics integration. - :type monitor_profile: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterMonitorProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'cluster_version': {'readonly': True}, - 'public_hostname': {'readonly': True}, - 'fqdn': {'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}'}, - 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'open_shift_version': {'key': 'properties.openShiftVersion', 'type': 'str'}, - 'cluster_version': {'key': 'properties.clusterVersion', 'type': 'str'}, - 'public_hostname': {'key': 'properties.publicHostname', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, - 'router_profiles': {'key': 'properties.routerProfiles', 'type': '[OpenShiftRouterProfile]'}, - 'master_pool_profile': {'key': 'properties.masterPoolProfile', 'type': 'OpenShiftManagedClusterMasterPoolProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[OpenShiftManagedClusterAgentPoolProfile]'}, - 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, - 'monitor_profile': {'key': 'properties.monitorProfile', 'type': 'OpenShiftManagedClusterMonitorProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedCluster, self).__init__(**kwargs) - self.plan = kwargs.get('plan', None) - self.provisioning_state = None - self.open_shift_version = kwargs.get('open_shift_version', None) - self.cluster_version = None - self.public_hostname = None - self.fqdn = None - self.network_profile = kwargs.get('network_profile', None) - self.router_profiles = kwargs.get('router_profiles', None) - self.master_pool_profile = kwargs.get('master_pool_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.auth_profile = kwargs.get('auth_profile', None) - self.monitor_profile = kwargs.get('monitor_profile', None) - - -class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): - """Structure for any Identity provider. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: OpenShiftManagedClusterAADIdentityProvider. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None # type: Optional[str] - - -class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): - """Defines the Identity provider for MS AAD. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) - self.kind = 'AADIdentityProvider' # type: str - self.client_id = kwargs.get('client_id', None) - self.secret = kwargs.get('secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.customer_admin_group_id = kwargs.get('customer_admin_group_id', None) - - -class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): - """Defines the configuration of the OpenShift cluster VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Unique name of the pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", - "infra". - :type role: str or - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftAgentPoolProfileRole - """ - - _validation = { - 'name': {'required': True}, - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', "10.0.0.0/24") - self.os_type = kwargs.get('os_type', "Linux") - self.role = kwargs.get('role', None) - - -class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): - """Defines all possible authentication profiles for the OpenShift cluster. - - :param identity_providers: Type of authentication profile to use. - :type identity_providers: - list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterIdentityProvider] - """ - - _attribute_map = { - 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) - self.identity_providers = kwargs.get('identity_providers', None) - - -class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): - """Defines the configuration of the identity providers to be used in the OpenShift cluster. - - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterBaseIdentityProvider - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.provider = kwargs.get('provider', None) - - -class OpenShiftManagedClusterListResult(msrest.serialization.Model): - """The response from the List OpenShift Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of OpenShift managed clusters. - :type value: - list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :ivar next_link: The URL to get the next set of OpenShift managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OpenShiftManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Unique name of the master pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of masters (VMs) to host docker containers. The default value is - 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType - """ - - _validation = { - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', None) - self.os_type = kwargs.get('os_type', "Linux") - - -class OpenShiftManagedClusterMonitorProfile(msrest.serialization.Model): - """Defines the configuration for Log Analytics integration. - - :param workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics - workspace to integrate with. - :type workspace_resource_id: str - :param enabled: If the Log analytics integration should be turned on or off. - :type enabled: bool - """ - - _attribute_map = { - 'workspace_resource_id': {'key': 'workspaceResourceID', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) - self.workspace_resource_id = kwargs.get('workspace_resource_id', None) - self.enabled = kwargs.get('enabled', None) - - -class OpenShiftRouterProfile(msrest.serialization.Model): - """Represents an OpenShift router. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Name of the router profile. - :type name: str - :ivar public_subdomain: DNS subdomain for OpenShift router. - :vartype public_subdomain: str - :ivar fqdn: Auto-allocated FQDN for the OpenShift router. - :vartype fqdn: str - """ - - _validation = { - 'public_subdomain': {'readonly': True}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'public_subdomain': {'key': 'publicSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftRouterProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.public_subdomain = None - self.fqdn = None - - -class PurchasePlan(msrest.serialization.Model): - """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value - as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PurchasePlan, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.product = kwargs.get('product', None) - self.promotion_code = kwargs.get('promotion_code', None) - self.publisher = kwargs.get('publisher', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py index b1df756f1b81..3a48ad8dc9b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_models_py3.py @@ -16,17 +16,17 @@ class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody] """ _attribute_map = { @@ -45,6 +45,20 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -55,12 +69,12 @@ def __init__( class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param peer_vnet_id: CIDR of the Vnet to peer. - :type peer_vnet_id: str - :param vnet_id: ID of the Vnet created for OSA cluster. - :type vnet_id: str + :ivar vnet_cidr: CIDR for the OpenShift Vnet. + :vartype vnet_cidr: str + :ivar peer_vnet_id: CIDR of the Vnet to peer. + :vartype peer_vnet_id: str + :ivar vnet_id: ID of the Vnet created for OSA cluster. + :vartype vnet_id: str """ _attribute_map = { @@ -77,6 +91,14 @@ def __init__( vnet_id: Optional[str] = None, **kwargs ): + """ + :keyword vnet_cidr: CIDR for the OpenShift Vnet. + :paramtype vnet_cidr: str + :keyword peer_vnet_id: CIDR of the Vnet to peer. + :paramtype peer_vnet_id: str + :keyword vnet_id: ID of the Vnet created for OSA cluster. + :paramtype vnet_id: str + """ super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.peer_vnet_id = peer_vnet_id @@ -96,10 +118,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -124,6 +146,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -145,39 +173,40 @@ class OpenShiftManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2019_09_30_preview.models.PurchasePlan + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar plan: Define the resource plan as required by ARM for billing purposes. + :vartype plan: ~azure.mgmt.containerservice.v2019_09_30_preview.models.PurchasePlan :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str + :ivar open_shift_version: Version of OpenShift specified when creating the cluster. + :vartype open_shift_version: str :ivar cluster_version: Version of OpenShift specified when creating the cluster. :vartype cluster_version: str :ivar public_hostname: Service generated FQDN for OpenShift API server. :vartype public_hostname: str :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer internal hostname. :vartype fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2019_09_30_preview.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: + :ivar network_profile: Configuration for OpenShift networking. + :vartype network_profile: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.NetworkProfile + :ivar router_profiles: Configuration for OpenShift router(s). + :vartype router_profiles: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: + :ivar master_pool_profile: Configuration for OpenShift master VMs. + :vartype master_pool_profile: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Configuration of OpenShift cluster VMs. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: + :ivar auth_profile: Configures OpenShift authentication. + :vartype auth_profile: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterAuthProfile - :param monitor_profile: Configures Log Analytics integration. - :type monitor_profile: + :ivar monitor_profile: Configures Log Analytics integration. + :vartype monitor_profile: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterMonitorProfile """ @@ -227,6 +256,34 @@ def __init__( monitor_profile: Optional["OpenShiftManagedClusterMonitorProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword plan: Define the resource plan as required by ARM for billing purposes. + :paramtype plan: ~azure.mgmt.containerservice.v2019_09_30_preview.models.PurchasePlan + :keyword open_shift_version: Version of OpenShift specified when creating the cluster. + :paramtype open_shift_version: str + :keyword network_profile: Configuration for OpenShift networking. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.NetworkProfile + :keyword router_profiles: Configuration for OpenShift router(s). + :paramtype router_profiles: + list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftRouterProfile] + :keyword master_pool_profile: Configuration for OpenShift master VMs. + :paramtype master_pool_profile: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterMasterPoolProfile + :keyword agent_pool_profiles: Configuration of OpenShift cluster VMs. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterAgentPoolProfile] + :keyword auth_profile: Configures OpenShift authentication. + :paramtype auth_profile: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterAuthProfile + :keyword monitor_profile: Configures Log Analytics integration. + :paramtype monitor_profile: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterMonitorProfile + """ super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -250,8 +307,8 @@ class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str """ _validation = { @@ -270,6 +327,8 @@ def __init__( self, **kwargs ): + """ + """ super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) self.kind = None # type: Optional[str] @@ -279,16 +338,16 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str + :ivar client_id: The clientId password associated with the provider. + :vartype client_id: str + :ivar secret: The secret password associated with the provider. + :vartype secret: str + :ivar tenant_id: The tenantId associated with the provider. + :vartype tenant_id: str + :ivar customer_admin_group_id: The groupId to be granted cluster admin role. + :vartype customer_admin_group_id: str """ _validation = { @@ -312,6 +371,16 @@ def __init__( customer_admin_group_id: Optional[str] = None, **kwargs ): + """ + :keyword client_id: The clientId password associated with the provider. + :paramtype client_id: str + :keyword secret: The secret password associated with the provider. + :paramtype secret: str + :keyword tenant_id: The tenantId associated with the provider. + :paramtype tenant_id: str + :keyword customer_admin_group_id: The groupId to be granted cluster admin role. + :paramtype customer_admin_group_id: str + """ super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id @@ -325,12 +394,12 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the pool profile in the context of the subscription and + :ivar name: Required. Unique name of the pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype name: str + :ivar count: Required. Number of agents (VMs) to host docker containers. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -338,16 +407,16 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType + :ivar role: Define the role of the AgentPoolProfile. Possible values include: "compute", "infra". - :type role: str or + :vartype role: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftAgentPoolProfileRole """ @@ -377,6 +446,32 @@ def __init__( role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, **kwargs ): + """ + :keyword name: Required. Unique name of the pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of agents (VMs) to host docker containers. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType + :keyword role: Define the role of the AgentPoolProfile. Possible values include: "compute", + "infra". + :paramtype role: str or + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftAgentPoolProfileRole + """ super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -389,8 +484,8 @@ def __init__( class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. - :param identity_providers: Type of authentication profile to use. - :type identity_providers: + :ivar identity_providers: Type of authentication profile to use. + :vartype identity_providers: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterIdentityProvider] """ @@ -404,6 +499,11 @@ def __init__( identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, **kwargs ): + """ + :keyword identity_providers: Type of authentication profile to use. + :paramtype identity_providers: + list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterIdentityProvider] + """ super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers @@ -411,10 +511,10 @@ def __init__( class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): """Defines the configuration of the identity providers to be used in the OpenShift cluster. - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: + :ivar name: Name of the provider. + :vartype name: str + :ivar provider: Configuration of the provider. + :vartype provider: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterBaseIdentityProvider """ @@ -430,6 +530,13 @@ def __init__( provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, **kwargs ): + """ + :keyword name: Name of the provider. + :paramtype name: str + :keyword provider: Configuration of the provider. + :paramtype provider: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterBaseIdentityProvider + """ super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider @@ -440,8 +547,8 @@ class OpenShiftManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of OpenShift managed clusters. - :type value: + :ivar value: The list of OpenShift managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] :ivar next_link: The URL to get the next set of OpenShift managed cluster results. :vartype next_link: str @@ -462,6 +569,11 @@ def __init__( value: Optional[List["OpenShiftManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of OpenShift managed clusters. + :paramtype value: + list[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] + """ super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -472,13 +584,13 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Unique name of the master pool profile in the context of the subscription and + :ivar name: Unique name of the master pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of masters (VMs) to host docker containers. The default value is + :vartype name: str + :ivar count: Required. Number of masters (VMs) to host docker containers. The default value is 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -486,13 +598,13 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType """ _validation = { @@ -518,6 +630,29 @@ def __init__( os_type: Optional[Union[str, "OSType"]] = "Linux", **kwargs ): + """ + :keyword name: Unique name of the master pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of masters (VMs) to host docker containers. The default value + is 3. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_09_30_preview.models.OSType + """ super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -529,11 +664,11 @@ def __init__( class OpenShiftManagedClusterMonitorProfile(msrest.serialization.Model): """Defines the configuration for Log Analytics integration. - :param workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics - workspace to integrate with. - :type workspace_resource_id: str - :param enabled: If the Log analytics integration should be turned on or off. - :type enabled: bool + :ivar workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics workspace + to integrate with. + :vartype workspace_resource_id: str + :ivar enabled: If the Log analytics integration should be turned on or off. + :vartype enabled: bool """ _attribute_map = { @@ -548,6 +683,13 @@ def __init__( enabled: Optional[bool] = None, **kwargs ): + """ + :keyword workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics + workspace to integrate with. + :paramtype workspace_resource_id: str + :keyword enabled: If the Log analytics integration should be turned on or off. + :paramtype enabled: bool + """ super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) self.workspace_resource_id = workspace_resource_id self.enabled = enabled @@ -558,8 +700,8 @@ class OpenShiftRouterProfile(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Name of the router profile. - :type name: str + :ivar name: Name of the router profile. + :vartype name: str :ivar public_subdomain: DNS subdomain for OpenShift router. :vartype public_subdomain: str :ivar fqdn: Auto-allocated FQDN for the OpenShift router. @@ -583,6 +725,10 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the router profile. + :paramtype name: str + """ super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = None @@ -592,15 +738,15 @@ def __init__( class PurchasePlan(msrest.serialization.Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value + :ivar name: The plan ID. + :vartype name: str + :ivar product: Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str + :vartype product: str + :ivar promotion_code: The promotion code. + :vartype promotion_code: str + :ivar publisher: The plan ID. + :vartype publisher: str """ _attribute_map = { @@ -619,6 +765,17 @@ def __init__( publisher: Optional[str] = None, **kwargs ): + """ + :keyword name: The plan ID. + :paramtype name: str + :keyword product: Specifies the product of the image from the marketplace. This is the same + value as Offer under the imageReference element. + :paramtype product: str + :keyword promotion_code: The promotion code. + :paramtype promotion_code: str + :keyword publisher: The plan ID. + :paramtype publisher: str + """ super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -629,8 +786,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -643,5 +800,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py index ea84df6b05f6..da66694d317f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/_open_shift_managed_clusters_operations.py @@ -5,25 +5,250 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. @@ -47,19 +272,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Gets a list of OpenShift managed clusters in the specified subscription. Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -67,34 +294,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +334,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Lists OpenShift managed clusters in the specified subscription and resource group. Lists OpenShift managed clusters in the specified subscription and resource group. The @@ -131,8 +354,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -140,35 +365,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +407,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": """Gets a OpenShift managed cluster. Gets the details of the managed OpenShift cluster with a specified resource group and name. @@ -216,27 +438,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -250,47 +462,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -308,16 +511,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -329,18 +534,24 @@ def begin_create_or_update( :type resource_name: str :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - :type parameters: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster + :type parameters: + ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -352,27 +563,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -384,47 +589,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -438,16 +633,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @@ -460,15 +657,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_09_30_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -480,27 +682,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -512,41 +708,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-30-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -559,13 +745,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an OpenShift managed cluster. Deletes the OpenShift managed cluster with a specified resource group and name. @@ -576,15 +763,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -598,21 +787,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -624,4 +806,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py index a5136bac09d5..a0167448eabe 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_container_service_client.py index 28f618b3d457..2a90ce116f54 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_10_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_10_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_10_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_10_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json index e1b591667702..6446991e9e79 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py index 162d74b196a2..76af0bca5f3a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_container_service_client.py index fdb5c98d50b8..c6baedbc6120 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_10_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_10_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_10_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2019_10_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2019_10_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py index 193966939d79..83068bf18e81 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py index 1f1b22261f2c..214c8b4b610d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -456,27 +433,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -490,8 +457,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -516,27 +486,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -550,8 +510,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -564,32 +526,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -607,8 +559,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -629,15 +584,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -649,27 +609,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -681,6 +635,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -695,32 +650,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -734,8 +679,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -755,15 +703,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -775,27 +728,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -807,6 +754,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -820,27 +768,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -853,6 +791,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -869,15 +809,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -891,21 +833,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -917,6 +852,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -931,32 +867,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -969,6 +895,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -986,18 +914,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1009,24 +941,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1038,6 +964,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1052,32 +979,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1090,6 +1007,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1110,15 +1029,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1130,24 +1052,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1159,6 +1075,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1172,27 +1089,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1205,6 +1112,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1221,15 +1130,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1243,21 +1154,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1269,4 +1173,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py index 9886838a8453..25a07acfb0e1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/__init__.py index 90e3057ac05e..2988c4a54d06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/__init__.py @@ -6,88 +6,47 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_container_service_client_enums.py index b481cccbda24..18f038fe5f80 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in PREVIEW. """ @@ -34,7 +19,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -42,7 +27,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -221,7 +206,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -230,35 +215,35 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -268,7 +253,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. """ @@ -276,7 +261,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models.py deleted file mode 100644 index 8f85317aa742..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models.py +++ /dev/null @@ -1,1819 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_10_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_10_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_10_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAPIServerAccessProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - """ - - _validation = { - 'enabled': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use - VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_10_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] - """ - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2019_10_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py index f2756b5b6910..7fa8cdbee0ec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,53 +104,53 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -203,6 +205,93 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -234,8 +323,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -258,6 +347,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -268,12 +362,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -290,6 +384,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -301,8 +403,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -322,6 +424,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -340,13 +446,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -375,6 +481,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -387,10 +503,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -405,6 +521,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -413,17 +535,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody] """ _attribute_map = { @@ -442,6 +564,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -454,8 +589,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMDiagnostics """ @@ -473,6 +608,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -482,10 +622,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -505,6 +645,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -517,12 +664,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_10_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2019_10_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -560,21 +707,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -603,13 +750,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2019_10_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -624,28 +832,29 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype docker_bridge_cidr: str + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_10_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_10_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfile """ @@ -680,6 +889,32 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_10_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -696,9 +931,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshPublicKey] """ @@ -716,6 +951,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -725,9 +966,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -744,6 +985,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -755,8 +1001,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -777,6 +1023,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -807,6 +1057,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -833,6 +1085,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -850,10 +1104,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -878,6 +1132,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -899,56 +1159,56 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAPIServerAccessProfile """ @@ -1010,6 +1270,51 @@ def __init__( api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAPIServerAccessProfile + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -1036,15 +1341,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -1068,6 +1373,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1088,12 +1404,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1120,6 +1436,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1129,10 +1453,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] """ _validation = { @@ -1151,6 +1475,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1161,10 +1491,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1202,52 +1532,52 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1296,6 +1626,92 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1323,10 +1739,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1364,55 +1780,55 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + :ivar availability_zones: (PREVIEW) Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1464,6 +1880,95 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_10_01.models.ScaleSetEvictionPolicy + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, node_taints=node_taints, **kwargs) self.name = name @@ -1471,10 +1976,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1489,6 +1994,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1505,11 +2016,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_10_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2019_10_01.models.ResourceIdentityType """ _validation = { @@ -1529,6 +2040,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_10_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1540,8 +2059,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1561,6 +2080,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1569,19 +2092,18 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] """ @@ -1601,6 +2123,22 @@ def __init__( effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -1611,9 +2149,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -1630,6 +2168,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -1637,8 +2180,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] """ @@ -1652,6 +2195,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -1659,8 +2207,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] """ _attribute_map = { @@ -1673,6 +2221,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -1682,15 +2234,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1715,6 +2267,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_10_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1725,10 +2289,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1743,6 +2307,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1753,10 +2323,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1775,6 +2345,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1793,12 +2369,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1825,6 +2401,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1838,22 +2423,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -1872,6 +2457,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -1898,6 +2501,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -1943,6 +2548,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1955,8 +2562,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -1969,6 +2576,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -1976,8 +2587,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -1990,5 +2601,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py index 0b69b1a3ed77..6e3e64161f48 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py index 45ade0b39bf2..d62e71dd589d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +796,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +821,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +850,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +874,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +903,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +927,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -467,27 +957,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -501,15 +981,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -528,27 +1010,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -562,47 +1034,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -620,16 +1083,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -643,15 +1108,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -663,27 +1133,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -695,47 +1159,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -749,16 +1203,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -771,15 +1227,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -791,27 +1252,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -823,41 +1278,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -870,13 +1315,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -887,15 +1333,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -909,21 +1357,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -935,47 +1376,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -988,14 +1419,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1006,18 +1438,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1029,24 +1465,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1058,47 +1488,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1111,14 +1531,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1132,15 +1553,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1152,24 +1576,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1181,41 +1599,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1228,13 +1636,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1245,15 +1654,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1267,21 +1678,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1293,4 +1697,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py index a4ecad273f20..e996b66fc7d9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py index 8ec15952c3a5..bbfd2708dcd6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py index 0a7d86edd4c3..ab87fe48da69 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py @@ -6,74 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse 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 . import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from . import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_10_27_preview.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2019_10_27_preview.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json index 1b646a89099e..661deedb59b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py index 849dbb94b24c..af3a71b7270d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_container_service_client.py index 0dfb6437b331..10e386ebcf65 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_container_service_client.py @@ -6,70 +6,80 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest 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 .. import models from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations - :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_10_27_preview.aio.operations.OpenShiftManagedClustersOperations + :vartype open_shift_managed_clusters: + azure.mgmt.containerservice.v2019_10_27_preview.aio.operations.OpenShiftManagedClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py index 724e35c85463..1c10a4b56838 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._open_shift_managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -209,27 +214,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -243,8 +238,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -257,32 +254,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -300,8 +287,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -320,18 +310,24 @@ async def begin_create_or_update( :type resource_name: str :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - :type parameters: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster + :type parameters: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -343,27 +339,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -375,6 +365,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -389,32 +380,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -428,8 +409,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -449,15 +433,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_10_27_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OpenShiftManagedCluster or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -469,27 +458,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -501,6 +484,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -514,27 +498,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -547,6 +521,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -563,15 +539,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -585,21 +563,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -611,4 +582,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py index f958ee9ba5d2..4d929cdcbe0b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py @@ -6,40 +6,23 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import CloudErrorBody - from ._models_py3 import NetworkProfile - from ._models_py3 import OpenShiftAPIProperties - from ._models_py3 import OpenShiftManagedCluster - from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider - from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile - from ._models_py3 import OpenShiftManagedClusterAuthProfile - from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider - from ._models_py3 import OpenShiftManagedClusterIdentityProvider - from ._models_py3 import OpenShiftManagedClusterListResult - from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile - from ._models_py3 import OpenShiftManagedClusterMonitorProfile - from ._models_py3 import OpenShiftRouterProfile - from ._models_py3 import PurchasePlan - from ._models_py3 import Resource - from ._models_py3 import TagsObject -except (SyntaxError, ImportError): - from ._models import CloudErrorBody # type: ignore - from ._models import NetworkProfile # type: ignore - from ._models import OpenShiftAPIProperties # type: ignore - from ._models import OpenShiftManagedCluster # type: ignore - from ._models import OpenShiftManagedClusterAADIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterAgentPoolProfile # type: ignore - from ._models import OpenShiftManagedClusterAuthProfile # type: ignore - from ._models import OpenShiftManagedClusterBaseIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterIdentityProvider # type: ignore - from ._models import OpenShiftManagedClusterListResult # type: ignore - from ._models import OpenShiftManagedClusterMasterPoolProfile # type: ignore - from ._models import OpenShiftManagedClusterMonitorProfile # type: ignore - from ._models import OpenShiftRouterProfile # type: ignore - from ._models import PurchasePlan # type: ignore - from ._models import Resource # type: ignore - from ._models import TagsObject # type: ignore +from ._models_py3 import CloudErrorBody +from ._models_py3 import NetworkProfile +from ._models_py3 import OpenShiftAPIProperties +from ._models_py3 import OpenShiftManagedCluster +from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider +from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile +from ._models_py3 import OpenShiftManagedClusterAuthProfile +from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider +from ._models_py3 import OpenShiftManagedClusterIdentityProvider +from ._models_py3 import OpenShiftManagedClusterListResult +from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile +from ._models_py3 import OpenShiftManagedClusterMonitorProfile +from ._models_py3 import OpenShiftRouterProfile +from ._models_py3 import PurchasePlan +from ._models_py3 import Resource +from ._models_py3 import TagsObject + from ._container_service_client_enums import ( OSType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py index 05a77b92092e..9cff02877c35 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftAgentPoolProfileRole(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. """ COMPUTE = "compute" INFRA = "infra" -class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OpenShiftContainerServiceVMSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of OpenShift VMs. """ @@ -71,7 +56,7 @@ class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, s STANDARD_L16_S = "Standard_L16s" STANDARD_L32_S = "Standard_L32s" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py deleted file mode 100644 index 2e9928ecb417..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py +++ /dev/null @@ -1,602 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class NetworkProfile(msrest.serialization.Model): - """Represents the OpenShift networking configuration. - - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param management_subnet_cidr: CIDR of subnet used to create PLS needed for management of the - cluster. - :type management_subnet_cidr: str - :param vnet_id: ID of the Vnet created for OSA cluster. - :type vnet_id: str - """ - - _attribute_map = { - 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, - 'management_subnet_cidr': {'key': 'managementSubnetCidr', 'type': 'str'}, - 'vnet_id': {'key': 'vnetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkProfile, self).__init__(**kwargs) - self.vnet_cidr = kwargs.get('vnet_cidr', "10.0.0.0/8") - self.management_subnet_cidr = kwargs.get('management_subnet_cidr', None) - self.vnet_id = kwargs.get('vnet_id', None) - - -class OpenShiftAPIProperties(msrest.serialization.Model): - """Defines further properties on the API. - - :param private_api_server: Specifies if API server is public or private. - :type private_api_server: bool - """ - - _attribute_map = { - 'private_api_server': {'key': 'privateApiServer', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftAPIProperties, self).__init__(**kwargs) - self.private_api_server = kwargs.get('private_api_server', None) - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class OpenShiftManagedCluster(Resource): - """OpenShift Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2019_10_27_preview.models.PurchasePlan - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str - :ivar cluster_version: Version of OpenShift specified when creating the cluster. - :vartype cluster_version: str - :ivar public_hostname: Service generated FQDN or private IP for OpenShift API server. - :vartype public_hostname: str - :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer internal hostname. - :vartype fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2019_10_27_preview.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: - list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAuthProfile - :param monitor_profile: Configures Log Analytics integration. - :type monitor_profile: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMonitorProfile - :param refresh_cluster: Allows node rotation. - :type refresh_cluster: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'cluster_version': {'readonly': True}, - 'public_hostname': {'readonly': True}, - 'fqdn': {'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}'}, - 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'open_shift_version': {'key': 'properties.openShiftVersion', 'type': 'str'}, - 'cluster_version': {'key': 'properties.clusterVersion', 'type': 'str'}, - 'public_hostname': {'key': 'properties.publicHostname', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, - 'router_profiles': {'key': 'properties.routerProfiles', 'type': '[OpenShiftRouterProfile]'}, - 'master_pool_profile': {'key': 'properties.masterPoolProfile', 'type': 'OpenShiftManagedClusterMasterPoolProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[OpenShiftManagedClusterAgentPoolProfile]'}, - 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, - 'monitor_profile': {'key': 'properties.monitorProfile', 'type': 'OpenShiftManagedClusterMonitorProfile'}, - 'refresh_cluster': {'key': 'properties.refreshCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedCluster, self).__init__(**kwargs) - self.plan = kwargs.get('plan', None) - self.provisioning_state = None - self.open_shift_version = kwargs.get('open_shift_version', None) - self.cluster_version = None - self.public_hostname = None - self.fqdn = None - self.network_profile = kwargs.get('network_profile', None) - self.router_profiles = kwargs.get('router_profiles', None) - self.master_pool_profile = kwargs.get('master_pool_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.auth_profile = kwargs.get('auth_profile', None) - self.monitor_profile = kwargs.get('monitor_profile', None) - self.refresh_cluster = kwargs.get('refresh_cluster', None) - - -class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): - """Structure for any Identity provider. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: OpenShiftManagedClusterAADIdentityProvider. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None # type: Optional[str] - - -class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): - """Defines the Identity provider for MS AAD. - - All required parameters must be populated in order to send to Azure. - - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str - """ - - _validation = { - 'kind': {'required': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) - self.kind = 'AADIdentityProvider' # type: str - self.client_id = kwargs.get('client_id', None) - self.secret = kwargs.get('secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.customer_admin_group_id = kwargs.get('customer_admin_group_id', None) - - -class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): - """Defines the configuration of the OpenShift cluster VMs. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Unique name of the pool profile in the context of the subscription and - resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", - "infra". - :type role: str or - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAgentPoolProfileRole - """ - - _validation = { - 'name': {'required': True}, - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', "10.0.0.0/24") - self.os_type = kwargs.get('os_type', "Linux") - self.role = kwargs.get('role', None) - - -class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): - """Defines all possible authentication profiles for the OpenShift cluster. - - :param identity_providers: Type of authentication profile to use. - :type identity_providers: - list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterIdentityProvider] - """ - - _attribute_map = { - 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) - self.identity_providers = kwargs.get('identity_providers', None) - - -class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): - """Defines the configuration of the identity providers to be used in the OpenShift cluster. - - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterBaseIdentityProvider - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.provider = kwargs.get('provider', None) - - -class OpenShiftManagedClusterListResult(msrest.serialization.Model): - """The response from the List OpenShift Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of OpenShift managed clusters. - :type value: - list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :ivar next_link: The URL to get the next set of OpenShift managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OpenShiftManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. - - All required parameters must be populated in order to send to Azure. - - :param count: Required. Number of masters (VMs) to host docker containers. The default value is - 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", - "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", - "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", - "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", - "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", - "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", - "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", - "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param api_properties: Defines further properties on the API. - :type api_properties: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAPIProperties - """ - - _validation = { - 'count': {'required': True}, - 'vm_size': {'required': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'api_properties': {'key': 'apiProperties', 'type': 'OpenShiftAPIProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) - self.count = kwargs['count'] - self.vm_size = kwargs['vm_size'] - self.subnet_cidr = kwargs.get('subnet_cidr', None) - self.api_properties = kwargs.get('api_properties', None) - - -class OpenShiftManagedClusterMonitorProfile(msrest.serialization.Model): - """Defines the configuration for Log Analytics integration. - - :param workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics - workspace to integrate with. - :type workspace_resource_id: str - :param enabled: If the Log analytics integration should be turned on or off. - :type enabled: bool - """ - - _attribute_map = { - 'workspace_resource_id': {'key': 'workspaceResourceID', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) - self.workspace_resource_id = kwargs.get('workspace_resource_id', None) - self.enabled = kwargs.get('enabled', None) - - -class OpenShiftRouterProfile(msrest.serialization.Model): - """Represents an OpenShift router. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Name of the router profile. - :type name: str - :ivar public_subdomain: DNS subdomain for OpenShift router. - :vartype public_subdomain: str - :ivar fqdn: Auto-allocated FQDN for the OpenShift router. - :vartype fqdn: str - """ - - _validation = { - 'public_subdomain': {'readonly': True}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'public_subdomain': {'key': 'publicSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OpenShiftRouterProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.public_subdomain = None - self.fqdn = None - - -class PurchasePlan(msrest.serialization.Model): - """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value - as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PurchasePlan, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.product = kwargs.get('product', None) - self.promotion_code = kwargs.get('promotion_code', None) - self.publisher = kwargs.get('publisher', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py index dbae13cd0286..ba8cce439696 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py @@ -16,17 +16,17 @@ class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] """ _attribute_map = { @@ -45,6 +45,20 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -55,13 +69,13 @@ def __init__( class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. - :type vnet_cidr: str - :param management_subnet_cidr: CIDR of subnet used to create PLS needed for management of the + :ivar vnet_cidr: CIDR for the OpenShift Vnet. + :vartype vnet_cidr: str + :ivar management_subnet_cidr: CIDR of subnet used to create PLS needed for management of the cluster. - :type management_subnet_cidr: str - :param vnet_id: ID of the Vnet created for OSA cluster. - :type vnet_id: str + :vartype management_subnet_cidr: str + :ivar vnet_id: ID of the Vnet created for OSA cluster. + :vartype vnet_id: str """ _attribute_map = { @@ -78,6 +92,15 @@ def __init__( vnet_id: Optional[str] = None, **kwargs ): + """ + :keyword vnet_cidr: CIDR for the OpenShift Vnet. + :paramtype vnet_cidr: str + :keyword management_subnet_cidr: CIDR of subnet used to create PLS needed for management of the + cluster. + :paramtype management_subnet_cidr: str + :keyword vnet_id: ID of the Vnet created for OSA cluster. + :paramtype vnet_id: str + """ super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.management_subnet_cidr = management_subnet_cidr @@ -87,8 +110,8 @@ def __init__( class OpenShiftAPIProperties(msrest.serialization.Model): """Defines further properties on the API. - :param private_api_server: Specifies if API server is public or private. - :type private_api_server: bool + :ivar private_api_server: Specifies if API server is public or private. + :vartype private_api_server: bool """ _attribute_map = { @@ -101,6 +124,10 @@ def __init__( private_api_server: Optional[bool] = None, **kwargs ): + """ + :keyword private_api_server: Specifies if API server is public or private. + :paramtype private_api_server: bool + """ super(OpenShiftAPIProperties, self).__init__(**kwargs) self.private_api_server = private_api_server @@ -118,10 +145,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -146,6 +173,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -167,42 +200,43 @@ class OpenShiftManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param plan: Define the resource plan as required by ARM for billing purposes. - :type plan: ~azure.mgmt.containerservice.v2019_10_27_preview.models.PurchasePlan + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar plan: Define the resource plan as required by ARM for billing purposes. + :vartype plan: ~azure.mgmt.containerservice.v2019_10_27_preview.models.PurchasePlan :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param open_shift_version: Version of OpenShift specified when creating the cluster. - :type open_shift_version: str + :ivar open_shift_version: Version of OpenShift specified when creating the cluster. + :vartype open_shift_version: str :ivar cluster_version: Version of OpenShift specified when creating the cluster. :vartype cluster_version: str :ivar public_hostname: Service generated FQDN or private IP for OpenShift API server. :vartype public_hostname: str :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer internal hostname. :vartype fqdn: str - :param network_profile: Configuration for OpenShift networking. - :type network_profile: ~azure.mgmt.containerservice.v2019_10_27_preview.models.NetworkProfile - :param router_profiles: Configuration for OpenShift router(s). - :type router_profiles: + :ivar network_profile: Configuration for OpenShift networking. + :vartype network_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.NetworkProfile + :ivar router_profiles: Configuration for OpenShift router(s). + :vartype router_profiles: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftRouterProfile] - :param master_pool_profile: Configuration for OpenShift master VMs. - :type master_pool_profile: + :ivar master_pool_profile: Configuration for OpenShift master VMs. + :vartype master_pool_profile: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMasterPoolProfile - :param agent_pool_profiles: Configuration of OpenShift cluster VMs. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Configuration of OpenShift cluster VMs. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAgentPoolProfile] - :param auth_profile: Configures OpenShift authentication. - :type auth_profile: + :ivar auth_profile: Configures OpenShift authentication. + :vartype auth_profile: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAuthProfile - :param monitor_profile: Configures Log Analytics integration. - :type monitor_profile: + :ivar monitor_profile: Configures Log Analytics integration. + :vartype monitor_profile: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMonitorProfile - :param refresh_cluster: Allows node rotation. - :type refresh_cluster: bool + :ivar refresh_cluster: Allows node rotation. + :vartype refresh_cluster: bool """ _validation = { @@ -253,6 +287,36 @@ def __init__( refresh_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword plan: Define the resource plan as required by ARM for billing purposes. + :paramtype plan: ~azure.mgmt.containerservice.v2019_10_27_preview.models.PurchasePlan + :keyword open_shift_version: Version of OpenShift specified when creating the cluster. + :paramtype open_shift_version: str + :keyword network_profile: Configuration for OpenShift networking. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.NetworkProfile + :keyword router_profiles: Configuration for OpenShift router(s). + :paramtype router_profiles: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftRouterProfile] + :keyword master_pool_profile: Configuration for OpenShift master VMs. + :paramtype master_pool_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMasterPoolProfile + :keyword agent_pool_profiles: Configuration of OpenShift cluster VMs. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAgentPoolProfile] + :keyword auth_profile: Configures OpenShift authentication. + :paramtype auth_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAuthProfile + :keyword monitor_profile: Configures Log Analytics integration. + :paramtype monitor_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMonitorProfile + :keyword refresh_cluster: Allows node rotation. + :paramtype refresh_cluster: bool + """ super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -277,8 +341,8 @@ class OpenShiftManagedClusterBaseIdentityProvider(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str """ _validation = { @@ -297,6 +361,8 @@ def __init__( self, **kwargs ): + """ + """ super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) self.kind = None # type: Optional[str] @@ -306,16 +372,16 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. The kind of the provider.Constant filled by server. - :type kind: str - :param client_id: The clientId password associated with the provider. - :type client_id: str - :param secret: The secret password associated with the provider. - :type secret: str - :param tenant_id: The tenantId associated with the provider. - :type tenant_id: str - :param customer_admin_group_id: The groupId to be granted cluster admin role. - :type customer_admin_group_id: str + :ivar kind: Required. The kind of the provider.Constant filled by server. + :vartype kind: str + :ivar client_id: The clientId password associated with the provider. + :vartype client_id: str + :ivar secret: The secret password associated with the provider. + :vartype secret: str + :ivar tenant_id: The tenantId associated with the provider. + :vartype tenant_id: str + :ivar customer_admin_group_id: The groupId to be granted cluster admin role. + :vartype customer_admin_group_id: str """ _validation = { @@ -339,6 +405,16 @@ def __init__( customer_admin_group_id: Optional[str] = None, **kwargs ): + """ + :keyword client_id: The clientId password associated with the provider. + :paramtype client_id: str + :keyword secret: The secret password associated with the provider. + :paramtype secret: str + :keyword tenant_id: The tenantId associated with the provider. + :paramtype tenant_id: str + :keyword customer_admin_group_id: The groupId to be granted cluster admin role. + :paramtype customer_admin_group_id: str + """ super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id @@ -352,12 +428,12 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Unique name of the pool profile in the context of the subscription and + :ivar name: Required. Unique name of the pool profile in the context of the subscription and resource group. - :type name: str - :param count: Required. Number of agents (VMs) to host docker containers. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype name: str + :ivar count: Required. Number of agents (VMs) to host docker containers. + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -365,16 +441,16 @@ class OpenShiftManagedClusterAgentPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OSType - :param role: Define the role of the AgentPoolProfile. Possible values include: "compute", + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OSType + :ivar role: Define the role of the AgentPoolProfile. Possible values include: "compute", "infra". - :type role: str or + :vartype role: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAgentPoolProfileRole """ @@ -404,6 +480,32 @@ def __init__( role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, **kwargs ): + """ + :keyword name: Required. Unique name of the pool profile in the context of the subscription and + resource group. + :paramtype name: str + :keyword count: Required. Number of agents (VMs) to host docker containers. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OSType + :keyword role: Define the role of the AgentPoolProfile. Possible values include: "compute", + "infra". + :paramtype role: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAgentPoolProfileRole + """ super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -416,8 +518,8 @@ def __init__( class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. - :param identity_providers: Type of authentication profile to use. - :type identity_providers: + :ivar identity_providers: Type of authentication profile to use. + :vartype identity_providers: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterIdentityProvider] """ @@ -431,6 +533,11 @@ def __init__( identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, **kwargs ): + """ + :keyword identity_providers: Type of authentication profile to use. + :paramtype identity_providers: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterIdentityProvider] + """ super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers @@ -438,10 +545,10 @@ def __init__( class OpenShiftManagedClusterIdentityProvider(msrest.serialization.Model): """Defines the configuration of the identity providers to be used in the OpenShift cluster. - :param name: Name of the provider. - :type name: str - :param provider: Configuration of the provider. - :type provider: + :ivar name: Name of the provider. + :vartype name: str + :ivar provider: Configuration of the provider. + :vartype provider: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterBaseIdentityProvider """ @@ -457,6 +564,13 @@ def __init__( provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, **kwargs ): + """ + :keyword name: Name of the provider. + :paramtype name: str + :keyword provider: Configuration of the provider. + :paramtype provider: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterBaseIdentityProvider + """ super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider @@ -467,8 +581,8 @@ class OpenShiftManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of OpenShift managed clusters. - :type value: + :ivar value: The list of OpenShift managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] :ivar next_link: The URL to get the next set of OpenShift managed cluster results. :vartype next_link: str @@ -489,6 +603,11 @@ def __init__( value: Optional[List["OpenShiftManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of OpenShift managed clusters. + :paramtype value: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + """ super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -499,10 +618,10 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Required. Number of masters (VMs) to host docker containers. The default value is + :ivar count: Required. Number of masters (VMs) to host docker containers. The default value is 3. - :type count: int - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + :vartype count: int + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", @@ -510,12 +629,12 @@ class OpenShiftManagedClusterMasterPoolProfile(msrest.serialization.Model): "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize - :param subnet_cidr: Subnet CIDR for the peering. - :type subnet_cidr: str - :param api_properties: Defines further properties on the API. - :type api_properties: + :ivar subnet_cidr: Subnet CIDR for the peering. + :vartype subnet_cidr: str + :ivar api_properties: Defines further properties on the API. + :vartype api_properties: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAPIProperties """ @@ -540,6 +659,26 @@ def __init__( api_properties: Optional["OpenShiftAPIProperties"] = None, **kwargs ): + """ + :keyword count: Required. Number of masters (VMs) to host docker containers. The default value + is 3. + :paramtype count: int + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_D2s_v3", + "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", + "Standard_D64s_v3", "Standard_DS4_v2", "Standard_DS5_v2", "Standard_F8s_v2", + "Standard_F16s_v2", "Standard_F32s_v2", "Standard_F64s_v2", "Standard_F72s_v2", "Standard_F8s", + "Standard_F16s", "Standard_E4s_v3", "Standard_E8s_v3", "Standard_E16s_v3", "Standard_E20s_v3", + "Standard_E32s_v3", "Standard_E64s_v3", "Standard_GS2", "Standard_GS3", "Standard_GS4", + "Standard_GS5", "Standard_DS12_v2", "Standard_DS13_v2", "Standard_DS14_v2", "Standard_DS15_v2", + "Standard_L4s", "Standard_L8s", "Standard_L16s", "Standard_L32s". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize + :keyword subnet_cidr: Subnet CIDR for the peering. + :paramtype subnet_cidr: str + :keyword api_properties: Defines further properties on the API. + :paramtype api_properties: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAPIProperties + """ super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -550,11 +689,11 @@ def __init__( class OpenShiftManagedClusterMonitorProfile(msrest.serialization.Model): """Defines the configuration for Log Analytics integration. - :param workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics - workspace to integrate with. - :type workspace_resource_id: str - :param enabled: If the Log analytics integration should be turned on or off. - :type enabled: bool + :ivar workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics workspace + to integrate with. + :vartype workspace_resource_id: str + :ivar enabled: If the Log analytics integration should be turned on or off. + :vartype enabled: bool """ _attribute_map = { @@ -569,6 +708,13 @@ def __init__( enabled: Optional[bool] = None, **kwargs ): + """ + :keyword workspace_resource_id: Azure Resource Manager Resource ID for the Log Analytics + workspace to integrate with. + :paramtype workspace_resource_id: str + :keyword enabled: If the Log analytics integration should be turned on or off. + :paramtype enabled: bool + """ super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) self.workspace_resource_id = workspace_resource_id self.enabled = enabled @@ -579,8 +725,8 @@ class OpenShiftRouterProfile(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Name of the router profile. - :type name: str + :ivar name: Name of the router profile. + :vartype name: str :ivar public_subdomain: DNS subdomain for OpenShift router. :vartype public_subdomain: str :ivar fqdn: Auto-allocated FQDN for the OpenShift router. @@ -604,6 +750,10 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the router profile. + :paramtype name: str + """ super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = None @@ -613,15 +763,15 @@ def __init__( class PurchasePlan(msrest.serialization.Model): """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - :param name: The plan ID. - :type name: str - :param product: Specifies the product of the image from the marketplace. This is the same value + :ivar name: The plan ID. + :vartype name: str + :ivar product: Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - :type product: str - :param promotion_code: The promotion code. - :type promotion_code: str - :param publisher: The plan ID. - :type publisher: str + :vartype product: str + :ivar promotion_code: The promotion code. + :vartype promotion_code: str + :ivar publisher: The plan ID. + :vartype publisher: str """ _attribute_map = { @@ -640,6 +790,17 @@ def __init__( publisher: Optional[str] = None, **kwargs ): + """ + :keyword name: The plan ID. + :paramtype name: str + :keyword product: Specifies the product of the image from the marketplace. This is the same + value as Offer under the imageReference element. + :paramtype product: str + :keyword promotion_code: The promotion code. + :paramtype promotion_code: str + :keyword publisher: The plan ID. + :paramtype publisher: str + """ super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -650,8 +811,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -664,5 +825,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py index c36097106531..da8e685743f7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py @@ -5,25 +5,250 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. @@ -47,19 +272,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Gets a list of OpenShift managed clusters in the specified subscription. Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each OpenShift managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -67,34 +294,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +334,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OpenShiftManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.OpenShiftManagedClusterListResult"]: """Lists OpenShift managed clusters in the specified subscription and resource group. Lists OpenShift managed clusters in the specified subscription and resource group. The @@ -131,8 +354,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 OpenShiftManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] + :return: An iterator like instance of either OpenShiftManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedClusterListResult"] @@ -140,35 +365,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OpenShiftManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("OpenShiftManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +407,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": """Gets a OpenShift managed cluster. Gets the details of the managed OpenShift cluster with a specified resource group and name. @@ -216,27 +438,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -250,47 +462,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'OpenShiftManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') - 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 @@ -308,16 +511,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.OpenShiftManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.OpenShiftManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Creates or updates an OpenShift managed cluster. Creates or updates a OpenShift managed cluster with the specified configuration for agents and @@ -329,18 +534,24 @@ def begin_create_or_update( :type resource_name: str :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. - :type parameters: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster + :type parameters: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -352,27 +563,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -384,47 +589,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.OpenShiftManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.OpenShiftManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -438,16 +633,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OpenShiftManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.OpenShiftManagedCluster"]: """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @@ -460,15 +657,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_10_27_preview.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 OpenShiftManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OpenShiftManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenShiftManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -480,27 +682,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -512,41 +708,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-27-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -559,13 +745,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an OpenShift managed cluster. Deletes the OpenShift managed cluster with a specified resource group and name. @@ -576,15 +763,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -598,21 +787,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -624,4 +806,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py index e7c824a3542e..fb5fb7fc7e4b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_container_service_client.py index 655c1d5542c5..fc075996df71 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_11_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_11_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_11_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_11_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json index 15c44cead249..b105cff0e87a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py index 1835526db31c..c54106f20ba7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_container_service_client.py index c59cd70c860d..6833b5e4447f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_11_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2019_11_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2019_11_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2019_11_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2019_11_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py index cab503f35d2a..ecd70079e1ef 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py index 2ed48ab7aff9..2b8e344982a9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -456,27 +433,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -490,8 +457,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -516,27 +486,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -550,8 +510,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -564,32 +526,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -607,8 +559,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -629,15 +584,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -649,27 +609,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -681,6 +635,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -695,32 +650,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -734,8 +679,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -755,15 +703,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -775,27 +728,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -807,6 +754,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -820,27 +768,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -853,6 +791,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -869,15 +809,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -891,21 +833,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -917,6 +852,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -931,32 +867,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -969,6 +895,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -986,18 +914,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1009,24 +941,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1038,6 +964,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1052,32 +979,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1090,6 +1007,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1110,15 +1029,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1130,24 +1052,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1159,6 +1075,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1172,27 +1089,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1205,6 +1112,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1221,15 +1130,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1243,21 +1154,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1269,4 +1173,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py index cc75555ff1e9..af4fddbb63e3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/__init__.py index 31731299ad0c..91d2c61fb783 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/__init__.py @@ -6,94 +6,50 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_container_service_client_enums.py index 8ab3311852d6..9e8d4ef7ae7b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -41,7 +26,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -220,7 +205,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -229,42 +214,42 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -274,7 +259,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. """ @@ -282,7 +267,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models.py deleted file mode 100644 index 3d2b8bcd4d3e..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models.py +++ /dev/null @@ -1,1953 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_11_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_11_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_11_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAPIServerAccessProfile - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_11_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2019_11_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py index 36e3e5e3b717..d8b0682bf358 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,58 +104,58 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -212,6 +214,98 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -245,8 +339,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -269,6 +363,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -279,12 +378,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -301,6 +400,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -312,8 +419,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -333,6 +440,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -351,13 +462,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -386,6 +497,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -398,10 +519,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -416,6 +537,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -424,17 +551,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody] """ _attribute_map = { @@ -453,6 +580,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -465,8 +605,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMDiagnostics """ @@ -484,6 +624,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -493,10 +638,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -516,6 +661,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -528,12 +680,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2019_11_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2019_11_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -571,21 +723,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -614,13 +766,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2019_11_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -635,31 +848,32 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2019_11_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_11_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfile """ @@ -696,6 +910,35 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_11_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -713,9 +956,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshPublicKey] """ @@ -733,6 +976,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -742,9 +991,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -761,6 +1010,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -772,8 +1026,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -794,6 +1048,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -824,6 +1082,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -850,6 +1110,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -867,10 +1129,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -895,6 +1157,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -916,59 +1184,59 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAPIServerAccessProfile - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -1032,6 +1300,54 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAPIServerAccessProfile + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -1059,15 +1375,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -1091,6 +1407,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1111,12 +1438,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1143,6 +1470,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1154,10 +1489,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAddonProfileIdentity @@ -1181,6 +1516,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1190,12 +1531,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1212,6 +1553,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1221,12 +1570,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1243,6 +1592,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1251,10 +1608,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1292,57 +1649,57 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1395,6 +1752,97 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1424,10 +1872,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1465,60 +1913,60 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1574,6 +2022,100 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2019_11_01.models.ScaleSetEvictionPolicy + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, tags=tags, node_labels=node_labels, node_taints=node_taints, **kwargs) self.name = name @@ -1581,10 +2123,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1599,6 +2141,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1615,11 +2163,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2019_11_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2019_11_01.models.ResourceIdentityType """ _validation = { @@ -1639,6 +2187,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2019_11_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1650,8 +2206,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1671,6 +2227,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1679,27 +2239,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -1727,6 +2286,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -1739,9 +2321,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -1758,6 +2340,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -1765,8 +2352,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] """ @@ -1780,6 +2367,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -1787,8 +2379,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] """ _attribute_map = { @@ -1801,6 +2393,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -1810,15 +2406,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1843,6 +2439,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2019_11_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1853,10 +2461,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1871,6 +2479,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1879,12 +2493,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1901,6 +2515,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1909,10 +2531,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1931,6 +2553,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1949,12 +2577,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1981,6 +2609,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1994,22 +2631,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -2028,6 +2665,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2054,6 +2709,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2099,6 +2756,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2111,8 +2770,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2125,6 +2784,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2132,8 +2795,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2146,5 +2809,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py index ef0928915345..e7f4c7148452 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py index 13e1ff162395..31f92c673fa8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +796,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +821,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +850,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +874,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +903,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +927,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -467,27 +957,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -501,15 +981,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -528,27 +1010,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -562,47 +1034,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -620,16 +1083,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -643,15 +1108,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -663,27 +1133,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -695,47 +1159,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -749,16 +1203,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -771,15 +1227,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -791,27 +1252,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -823,41 +1278,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -870,13 +1315,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -887,15 +1333,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -909,21 +1357,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -935,47 +1376,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -988,14 +1419,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1006,18 +1438,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1029,24 +1465,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1058,47 +1488,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1111,14 +1531,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1132,15 +1553,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1152,24 +1576,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1181,41 +1599,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1228,13 +1636,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1245,15 +1654,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1267,21 +1678,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1293,4 +1697,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py index c2129ead1333..95fea98cd3d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2019-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2019_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py index 1ffb97662504..adb513efadb2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_container_service_client.py index 0ed95341a464..4c809a1d5efa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_01_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_01_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_01_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_01_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json index 699309263a9b..a21bd277e843 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py index f064b59a8a2f..55fca9d4872d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_container_service_client.py index 698b5be73573..ceabbe399e40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_01_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_01_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_01_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_01_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_01_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py index 06b457b7e87e..6a35d2858fb9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py index cb3a5f7fcd6f..1e1aceee6aa9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -456,27 +433,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -490,8 +457,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -516,27 +486,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -550,8 +510,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -564,32 +526,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -607,8 +559,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -629,15 +584,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -649,27 +609,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -681,6 +635,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -695,32 +650,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -734,8 +679,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -755,15 +703,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -775,27 +728,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -807,6 +754,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -820,27 +768,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -853,6 +791,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -869,15 +809,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -891,21 +833,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -917,6 +852,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -931,32 +867,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -969,6 +895,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -986,18 +914,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1009,24 +941,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1038,6 +964,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1052,32 +979,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1090,6 +1007,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1110,15 +1029,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1130,24 +1052,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1159,6 +1075,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1172,27 +1089,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1205,6 +1112,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1221,15 +1130,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1243,21 +1154,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1269,4 +1173,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py index 756a0c920e26..827605664ecf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/__init__.py index 31731299ad0c..91d2c61fb783 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/__init__.py @@ -6,94 +6,50 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_container_service_client_enums.py index 8ab3311852d6..9e8d4ef7ae7b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -41,7 +26,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -220,7 +205,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -229,42 +214,42 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -274,7 +259,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. """ @@ -282,7 +267,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models.py deleted file mode 100644 index 964bcab5bc96..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models.py +++ /dev/null @@ -1,1958 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_01_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_01_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_01_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_01_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_01_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py index 53b4154aae91..8aa8ea840b64 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,58 +104,58 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -212,6 +214,98 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -245,8 +339,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -269,6 +363,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -279,12 +378,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -301,6 +400,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -312,8 +419,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -333,6 +440,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -351,13 +462,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -386,6 +497,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -398,10 +519,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -416,6 +537,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -424,17 +551,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody] """ _attribute_map = { @@ -453,6 +580,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -465,8 +605,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMDiagnostics """ @@ -484,6 +624,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -493,10 +638,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -516,6 +661,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -528,12 +680,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_01_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_01_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -571,21 +723,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -614,13 +766,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_01_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -635,31 +848,32 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPolicy - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPolicy + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_01_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_01_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfile """ @@ -696,6 +910,35 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.NetworkPolicy + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_01_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -713,9 +956,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshPublicKey] """ @@ -733,6 +976,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -742,9 +991,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -761,6 +1010,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -772,8 +1026,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -794,6 +1048,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -824,6 +1082,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -850,6 +1110,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -867,10 +1129,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -895,6 +1157,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -916,62 +1184,62 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -1037,6 +1305,57 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -1065,15 +1384,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -1097,6 +1416,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1117,12 +1447,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1149,6 +1479,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1160,10 +1498,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAddonProfileIdentity @@ -1187,6 +1525,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1196,12 +1540,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1218,6 +1562,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1227,12 +1579,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1249,6 +1601,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1257,10 +1617,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1298,57 +1658,57 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1401,6 +1761,97 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1430,10 +1881,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1471,60 +1922,60 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1580,6 +2031,100 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for low priority virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_01_01.models.ScaleSetEvictionPolicy + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, tags=tags, node_labels=node_labels, node_taints=node_taints, **kwargs) self.name = name @@ -1587,10 +2132,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1605,6 +2150,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1621,11 +2172,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_01_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2020_01_01.models.ResourceIdentityType """ _validation = { @@ -1645,6 +2196,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_01_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1656,8 +2215,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1677,6 +2236,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1685,27 +2248,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -1733,6 +2295,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -1745,9 +2330,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -1764,6 +2349,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -1771,8 +2361,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] """ @@ -1786,6 +2376,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -1793,8 +2388,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] """ _attribute_map = { @@ -1807,6 +2402,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -1816,15 +2415,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1849,6 +2448,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_01_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1859,10 +2470,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1877,6 +2488,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1885,12 +2502,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1907,6 +2524,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1915,10 +2540,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -1937,6 +2562,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -1955,12 +2586,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -1987,6 +2618,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2000,22 +2640,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -2034,6 +2674,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2060,6 +2718,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2105,6 +2765,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2117,8 +2779,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2131,6 +2793,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2138,8 +2804,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2152,5 +2818,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py index b67aa95e410f..37c937f84f29 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py index 534320126360..bbf0209dfe8c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +796,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +821,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +850,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +874,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +903,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +927,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -467,27 +957,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -501,15 +981,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -528,27 +1010,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -562,47 +1034,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -620,16 +1083,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -643,15 +1108,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -663,27 +1133,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -695,47 +1159,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -749,16 +1203,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -771,15 +1227,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -791,27 +1252,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -823,41 +1278,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-01-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -870,13 +1315,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -887,15 +1333,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -909,21 +1357,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -935,47 +1376,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -988,14 +1419,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1006,18 +1438,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1029,24 +1465,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1058,47 +1488,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1111,14 +1531,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1132,15 +1553,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1152,24 +1576,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1181,41 +1599,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-01-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1228,13 +1636,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1245,15 +1654,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1267,21 +1678,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1293,4 +1697,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py index 5d0ed3d56dd3..ff2128105709 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_01_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py index 45f7db14a8c9..8d2967cbafd9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_container_service_client.py index 711d896e476a..205c73e9820e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_02_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_02_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_02_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_02_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json index 088d7dcb2ee4..6349cb79e0f3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py index bd4ae14a015e..50543c14fbe0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_container_service_client.py index 4278545ab29e..03fba7f387a0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_02_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_02_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_02_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_02_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_02_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py index 345f02355041..74a9ab2392cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py index dbf199573ef0..1c03ed642729 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -456,27 +433,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -490,8 +457,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -516,27 +486,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -550,8 +510,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -564,32 +526,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -607,8 +559,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -629,15 +584,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -649,27 +609,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -681,6 +635,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -695,32 +650,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -734,8 +679,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -755,15 +703,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -775,27 +728,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -807,6 +754,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -820,27 +768,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -853,6 +791,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -869,15 +809,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -891,21 +833,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -917,6 +852,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -931,32 +867,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -969,6 +895,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -986,18 +914,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1009,24 +941,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1038,6 +964,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1052,32 +979,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1090,6 +1007,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1110,15 +1029,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1130,24 +1052,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1159,6 +1075,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1172,27 +1089,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1205,6 +1112,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1221,15 +1130,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1243,21 +1154,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1269,4 +1173,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py index 76a28f792c3d..03e5bba378c2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/__init__.py index e3d019e1413e..776ffc5504ca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/__init__.py @@ -6,96 +6,51 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolType, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_container_service_client_enums.py index 83c354340884..10d3817c531a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_container_service_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -41,7 +26,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -220,7 +205,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -229,49 +214,49 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -281,7 +266,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. """ @@ -289,7 +274,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models.py deleted file mode 100644 index 98d35b851d5a..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models.py +++ /dev/null @@ -1,2032 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_02_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_02_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_02_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - All required parameters must be populated in order to send to Azure. - - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _validation = { - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_02_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - """ - - _attribute_map = { - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_02_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py index 866f4a6a0cd4..ce78eb5a7c4e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,10 +63,10 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -102,62 +104,62 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -218,6 +220,102 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values + include: "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -252,8 +350,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -276,6 +374,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -286,12 +389,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -308,6 +411,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -319,8 +430,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -340,6 +451,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -358,13 +473,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -393,6 +508,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -405,10 +530,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -423,6 +548,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -431,17 +562,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -460,6 +591,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -472,8 +616,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMDiagnostics """ @@ -491,6 +635,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -500,10 +649,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -523,6 +672,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -535,12 +691,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_02_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_02_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -578,21 +734,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -621,13 +777,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_02_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -642,34 +859,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_02_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_02_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfile """ @@ -708,6 +926,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_02_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_02_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -726,9 +976,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshPublicKey] """ @@ -746,6 +996,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -755,9 +1011,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -774,6 +1030,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -785,8 +1046,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -807,6 +1068,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -837,6 +1102,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -863,6 +1130,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -880,10 +1149,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -908,6 +1177,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -929,65 +1204,65 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -1055,6 +1330,60 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -1084,15 +1413,15 @@ class ManagedClusterAADProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_app_id: Required. The client AAD application ID. - :type client_app_id: str - :param server_app_id: Required. The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar client_app_id: Required. The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: Required. The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _validation = { @@ -1116,6 +1445,17 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword client_app_id: Required. The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: Required. The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1136,12 +1476,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1168,6 +1508,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1179,10 +1527,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAddonProfileIdentity @@ -1206,6 +1554,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1215,12 +1569,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1237,6 +1591,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1246,12 +1608,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1268,6 +1630,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1276,10 +1646,10 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1317,61 +1687,61 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1426,6 +1796,101 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values + include: "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1456,10 +1921,10 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1497,64 +1962,64 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1612,6 +2077,104 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolType + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values + include: "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_02_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, **kwargs) self.name = name @@ -1619,10 +2182,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1637,6 +2200,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1653,11 +2222,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_02_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2020_02_01.models.ResourceIdentityType """ _validation = { @@ -1677,6 +2246,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_02_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1688,8 +2265,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1709,6 +2286,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1717,27 +2298,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -1765,6 +2345,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -1777,9 +2380,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -1796,6 +2399,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -1803,8 +2411,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] """ @@ -1818,6 +2426,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -1825,8 +2438,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] """ _attribute_map = { @@ -1839,6 +2452,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -1848,15 +2465,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -1881,6 +2498,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_02_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1891,10 +2520,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -1909,6 +2538,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1917,22 +2552,22 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str """ _attribute_map = { @@ -1959,6 +2594,24 @@ def __init__( max_graceful_termination_sec: Optional[str] = None, **kwargs ): + """ + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.scan_interval = scan_interval self.scale_down_delay_after_add = scale_down_delay_after_add @@ -1973,12 +2626,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1995,6 +2648,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2003,10 +2664,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2025,6 +2686,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2043,12 +2710,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2075,6 +2742,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2088,22 +2764,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -2122,6 +2798,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2148,6 +2842,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2193,6 +2889,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2205,8 +2903,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2219,6 +2917,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2226,8 +2928,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2240,5 +2942,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py index ca4398f730a8..88ceaeb0b336 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py index 803c15dd88bc..f1b08c7ab671 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +796,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +821,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +850,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +874,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +903,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +927,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -467,27 +957,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -501,15 +981,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -528,27 +1010,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -562,47 +1034,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -620,16 +1083,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -643,15 +1108,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -663,27 +1133,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -695,47 +1159,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -749,16 +1203,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -771,15 +1227,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -791,27 +1252,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -823,41 +1278,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -870,13 +1315,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -887,15 +1333,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -909,21 +1357,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -935,47 +1376,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -988,14 +1419,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1006,18 +1438,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1029,24 +1465,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1058,47 +1488,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1111,14 +1531,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1132,15 +1553,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1152,24 +1576,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1181,41 +1599,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-02-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1228,13 +1636,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1245,15 +1654,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1267,21 +1678,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1293,4 +1697,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py index 4419d8347661..f0925da67fe5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py index a8ce5d1af993..ed7526d58820 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py index 1ead889709f3..117ba4c5769e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_03_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_03_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_03_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_03_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json index be9bcb3d1617..91216ac4b618 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py index 353d3cbbff2b..ead3db4a4bae 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py index efd29a0a8488..3dfc44c8f643 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_03_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_03_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_03_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_03_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_03_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py index 5e6b57b5f718..aa895eff7934 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py index 953d21bbe7cc..0d7db5635fed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -274,28 +272,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -309,8 +297,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -335,27 +326,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +350,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -395,27 +379,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -429,8 +403,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -456,27 +433,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -490,8 +457,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -516,27 +486,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -550,8 +510,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -564,32 +526,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -607,8 +559,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -629,15 +584,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -649,27 +609,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -681,6 +635,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -695,32 +650,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -734,8 +679,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -755,15 +703,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -775,27 +728,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -807,6 +754,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -820,27 +768,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -853,6 +791,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -869,15 +809,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -891,21 +833,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -917,6 +852,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -931,32 +867,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -969,6 +895,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -986,18 +914,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1009,24 +941,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1038,6 +964,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1052,32 +979,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1090,6 +1007,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1110,15 +1029,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1130,24 +1052,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1159,6 +1075,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1172,27 +1089,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1205,6 +1112,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1221,15 +1130,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1243,21 +1154,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1269,4 +1173,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py index 77253c807bab..73ef42f54a25 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/__init__.py index e995f09726be..c087ee137f98 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/__init__.py @@ -6,100 +6,53 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import BaseManagedCluster - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import BaseManagedCluster # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import BaseManagedCluster +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_container_service_client_enums.py index 17ff356e0558..7ec3306282c9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_container_service_client_enums.py @@ -6,41 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -48,7 +33,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -227,7 +212,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -236,62 +221,62 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -301,7 +286,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. """ @@ -309,7 +294,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models.py deleted file mode 100644 index cda9782de634..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models.py +++ /dev/null @@ -1,2209 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class BaseManagedCluster(msrest.serialization.Model): - """BaseManagedCluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(BaseManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_03_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_03_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_03_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, BaseManagedCluster): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesIdentityProfileValue] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: - "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_03_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_03_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py index 987b2ad687c9..dc34fe45b3ac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,11 +63,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -103,65 +105,65 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -224,6 +226,106 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values + include: "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -259,8 +361,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -283,6 +385,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -293,12 +400,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -315,6 +422,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -326,8 +441,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -347,6 +462,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -365,13 +484,13 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] """ @@ -400,6 +519,16 @@ def __init__( upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -412,10 +541,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -430,6 +559,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -440,61 +575,61 @@ class BaseManagedCluster(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -551,6 +686,56 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(BaseManagedCluster, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -578,17 +763,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -607,6 +792,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -619,8 +817,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMDiagnostics """ @@ -638,6 +836,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -647,10 +850,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -670,6 +873,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -682,12 +892,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_03_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_03_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -725,21 +935,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -768,13 +978,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_03_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -789,34 +1060,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_03_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_03_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfile """ @@ -855,6 +1127,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_03_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -873,9 +1177,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshPublicKey] """ @@ -893,6 +1197,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -902,9 +1212,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -921,6 +1231,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -932,8 +1247,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -954,6 +1269,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -984,6 +1303,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1010,6 +1331,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1027,10 +1350,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1055,6 +1378,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1070,61 +1399,61 @@ class ManagedCluster(Resource, BaseManagedCluster): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesIdentityProfileValue] :ivar id: Resource Id. :vartype id: str @@ -1132,12 +1461,12 @@ class ManagedCluster(Resource, BaseManagedCluster): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKU """ _validation = { @@ -1206,6 +1535,62 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPropertiesIdentityProfileValue] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1240,19 +1625,19 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1275,6 +1660,22 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.admin_group_object_i_ds = admin_group_object_i_ds @@ -1297,12 +1698,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1329,6 +1730,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1340,10 +1749,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAddonProfileIdentity @@ -1367,6 +1776,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1376,12 +1791,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1398,6 +1813,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1407,12 +1830,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1429,6 +1852,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1437,11 +1868,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1479,64 +1910,64 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1593,6 +2024,105 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values + include: "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1624,11 +2154,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1666,67 +2196,67 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1786,6 +2316,108 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Low", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot or low priority virtual machine scale set. Default to Delete. Possible values + include: "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_03_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, **kwargs) self.name = name @@ -1793,10 +2425,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1811,6 +2443,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1827,11 +2465,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_03_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.ResourceIdentityType """ _validation = { @@ -1851,6 +2489,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_03_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1862,8 +2508,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1883,6 +2529,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1891,27 +2541,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -1939,6 +2588,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -1951,9 +2623,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -1970,6 +2642,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -1977,8 +2654,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] """ @@ -1992,6 +2669,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -1999,8 +2681,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] """ _attribute_map = { @@ -2013,6 +2695,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2022,15 +2708,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2055,6 +2741,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_03_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2065,10 +2763,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2083,6 +2781,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2091,24 +2795,24 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str """ _attribute_map = { @@ -2137,6 +2841,26 @@ def __init__( max_graceful_termination_sec: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.scan_interval = scan_interval @@ -2152,12 +2876,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -2174,6 +2898,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2182,10 +2914,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2204,6 +2936,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2212,10 +2950,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2230,6 +2968,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2248,12 +2992,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2280,6 +3024,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2293,22 +3046,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -2327,6 +3080,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2353,6 +3124,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2398,6 +3171,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2410,8 +3185,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2424,6 +3199,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2431,8 +3210,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2445,5 +3224,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py index 5a05ac816ee0..cf118eedec1d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py index 770680ab390c..fc6d04150e1f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -282,28 +796,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,15 +821,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -344,27 +850,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,15 +874,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -405,27 +903,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -439,15 +927,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -467,27 +957,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -501,15 +981,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -528,27 +1010,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -562,47 +1034,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -620,16 +1083,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -643,15 +1108,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -663,27 +1133,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -695,47 +1159,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -749,16 +1203,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -771,15 +1227,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -791,27 +1252,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -823,41 +1278,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -870,13 +1315,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -887,15 +1333,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -909,21 +1357,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -935,47 +1376,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -988,14 +1419,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1006,18 +1438,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1029,24 +1465,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1058,47 +1488,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1111,14 +1531,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1132,15 +1553,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1152,24 +1576,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1181,41 +1599,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1228,13 +1636,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1245,15 +1654,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1267,21 +1678,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1293,4 +1697,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py index d1d192bd6e10..b326c4983db9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_03_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py index 24e19acdd8ea..f50becd653bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_container_service_client.py index dc3399c5193d..716511c0c84b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_container_service_client.py @@ -6,84 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_04_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_04_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_04_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_04_01.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json index 3cfbd62fd7a2..e5fe5ec70e66 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py index fb539a3eea08..bc5df4e286f7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_container_service_client.py index 83d1d5360eca..767a146651da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_container_service_client.py @@ -6,80 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_04_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_04_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_04_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_04_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_04_01.aio.operations.AgentPoolsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py index 90d713cec48e..b752a3dc29dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py index e00bffaed520..ace95a0e20a3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,4 +1177,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py index 0e4c1d757bab..3a993536f85a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py index 4361ad6f8d43..60aa30eba452 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py @@ -6,102 +6,54 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import BaseManagedCluster - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import BaseManagedCluster # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import BaseManagedCluster +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_container_service_client_enums.py index a1c59e35e778..8003b6350d2f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_container_service_client_enums.py @@ -6,41 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -48,7 +33,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -227,7 +212,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -236,62 +221,62 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -301,7 +286,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SYSTEM_ASSIGNED = "SystemAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -309,7 +294,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models.py deleted file mode 100644 index ac88bc74286e..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models.py +++ /dev/null @@ -1,2259 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = kwargs.get('node_image_version', None) - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class BaseManagedCluster(msrest.serialization.Model): - """BaseManagedCluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(BaseManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_04_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_04_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_04_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_04_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, BaseManagedCluster): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesIdentityProfileValue] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = kwargs.get('node_image_version', None) - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_04_01.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_04_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py index ef288e59a6dd..ff6e77fc9a5f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,11 +63,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -103,70 +105,70 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :vartype orchestrator_version: str + :ivar node_image_version: Version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -233,6 +235,111 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword node_image_version: Version of node image. + :paramtype node_image_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -270,8 +377,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -294,6 +401,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -304,12 +416,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -326,6 +438,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -337,8 +457,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -358,6 +478,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -376,17 +500,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -416,6 +540,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -429,10 +566,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -447,6 +584,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -455,9 +598,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -470,6 +613,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -479,61 +627,61 @@ class BaseManagedCluster(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -590,6 +738,56 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(BaseManagedCluster, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -617,17 +815,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_04_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_04_01.models.CloudErrorBody] """ _attribute_map = { @@ -646,6 +844,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_04_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -658,8 +869,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMDiagnostics """ @@ -677,6 +888,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -686,10 +902,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -709,6 +925,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -721,12 +944,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_04_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_04_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -764,21 +987,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -807,13 +1030,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_04_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -828,34 +1112,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_04_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_04_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfile """ @@ -894,6 +1179,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_04_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -912,9 +1229,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshPublicKey] """ @@ -932,6 +1249,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -941,9 +1264,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -960,6 +1283,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -971,8 +1299,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -993,6 +1321,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1023,6 +1355,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1049,6 +1383,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1066,10 +1402,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1094,6 +1430,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1109,61 +1451,61 @@ class ManagedCluster(Resource, BaseManagedCluster): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesIdentityProfileValue] :ivar id: Resource Id. :vartype id: str @@ -1171,12 +1513,12 @@ class ManagedCluster(Resource, BaseManagedCluster): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKU """ _validation = { @@ -1245,6 +1587,62 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPropertiesIdentityProfileValue] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1279,19 +1677,19 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1314,6 +1712,22 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.admin_group_object_i_ds = admin_group_object_i_ds @@ -1336,12 +1750,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1368,6 +1782,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1379,10 +1801,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAddonProfileIdentity @@ -1406,6 +1828,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1415,12 +1843,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1437,6 +1865,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1446,12 +1882,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1468,6 +1904,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1476,11 +1920,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1518,69 +1962,69 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :vartype orchestrator_version: str + :ivar node_image_version: Version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] + :vartype node_taints: list[str] """ _validation = { @@ -1641,6 +2085,110 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword node_image_version: Version of node image. + :paramtype node_image_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1674,11 +2222,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1716,72 +2264,72 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :vartype orchestrator_version: str + :ivar node_image_version: Version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1845,6 +2393,113 @@ def __init__( node_taints: Optional[List[str]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword node_image_version: Version of node image. + :paramtype node_image_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_04_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, node_image_version=node_image_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, **kwargs) self.name = name @@ -1852,10 +2507,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1870,6 +2525,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1886,11 +2547,11 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_04_01.models.ResourceIdentityType + :vartype type: str or ~azure.mgmt.containerservice.v2020_04_01.models.ResourceIdentityType """ _validation = { @@ -1910,6 +2571,14 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_04_01.models.ResourceIdentityType + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1921,8 +2590,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -1942,6 +2611,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1950,27 +2623,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -1998,6 +2670,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2010,9 +2705,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2029,6 +2724,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2036,8 +2736,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] """ @@ -2051,6 +2751,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2058,8 +2763,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] """ _attribute_map = { @@ -2072,6 +2777,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_04_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2081,15 +2790,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2114,6 +2823,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_04_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2124,10 +2845,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2142,6 +2863,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2150,24 +2877,24 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str """ _attribute_map = { @@ -2196,6 +2923,26 @@ def __init__( max_graceful_termination_sec: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.scan_interval = scan_interval @@ -2211,12 +2958,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -2233,6 +2980,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2241,10 +2996,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2263,6 +3018,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2271,10 +3032,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2289,6 +3050,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2307,12 +3074,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2339,6 +3106,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2352,22 +3128,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -2386,6 +3162,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2412,6 +3206,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2457,6 +3253,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2469,8 +3267,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2483,6 +3281,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2490,8 +3292,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2504,5 +3306,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py index 14c0b9dc0e62..ba4bdaefd030 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_04_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py index ec95d1eeef78..b6aaec21b179 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +800,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +825,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +854,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +878,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +907,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +931,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +961,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +985,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1014,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1038,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1087,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1112,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1137,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1163,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1207,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1231,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1256,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1282,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1319,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1337,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1361,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1380,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1423,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1442,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1469,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1492,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1535,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1557,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1580,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1603,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-04-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1640,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1658,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1682,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,4 +1701,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py index 1593c6245d93..e294d433ce49 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py index 516cb1668945..b835458d0c8e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_container_service_client.py index 52366da65473..a25fceaf8b00 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_container_service_client.py @@ -6,89 +6,90 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_06_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_06_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_06_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_06_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_06_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_06_01.operations.PrivateEndpointConnectionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json index ae0a36f7b30d..26ffe8b7f4d2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py index b3bb469c1d64..585058b6f419 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_container_service_client.py index 2190cbfcc728..069642f81b8b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_container_service_client.py @@ -6,85 +6,91 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_06_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_06_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_06_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_06_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_06_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_06_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_06_01.aio.operations.PrivateEndpointConnectionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py index acdf31fb0737..4d8a6d52aa05 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,4 +522,6 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py index 5e413190eea8..9a447d922914 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,4 +1177,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py index 9e5d12506455..cf243002f66b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py index ddfd1b3fcaa1..15bebc8d9fd9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py index 622f72e11912..f1841221e822 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py @@ -6,112 +6,59 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import BaseManagedCluster - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterIdentityUserAssignedIdentitiesValue - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import BaseManagedCluster # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import BaseManagedCluster +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterIdentityUserAssignedIdentitiesValue +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_container_service_client_enums.py index 8230244dfb78..bd1e8fe8fe40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_container_service_client_enums.py @@ -6,41 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -49,7 +34,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -57,7 +42,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -236,7 +221,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -245,62 +230,62 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -309,7 +294,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -320,7 +305,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -328,7 +313,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models.py deleted file mode 100644 index d3372d3b68ea..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models.py +++ /dev/null @@ -1,2427 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = kwargs.get('node_image_version', None) - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class BaseManagedCluster(msrest.serialization.Model): - """BaseManagedCluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(BaseManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_06_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_06_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_06_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_06_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, BaseManagedCluster): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesIdentityProfileValue] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = kwargs.get('node_image_version', None) - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_06_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedClusterIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedClusterIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_06_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2020_06_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_06_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py index 59114154b9c1..555aed3784a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,11 +63,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -103,72 +105,72 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :vartype orchestrator_version: str + :ivar node_image_version: Version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str """ _validation = { @@ -237,6 +239,113 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword node_image_version: Version of node image. + :paramtype node_image_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -275,8 +384,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -299,6 +408,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -309,12 +423,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -331,6 +445,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -342,8 +464,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -363,6 +485,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -381,17 +507,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -421,6 +547,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -434,10 +573,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -452,6 +591,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -460,9 +605,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -475,6 +620,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -484,61 +634,61 @@ class BaseManagedCluster(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -595,6 +745,56 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(BaseManagedCluster, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -622,17 +822,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_06_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_06_01.models.CloudErrorBody] """ _attribute_map = { @@ -651,6 +851,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_06_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -663,8 +876,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMDiagnostics """ @@ -682,6 +895,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -691,10 +909,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -714,6 +932,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -726,12 +951,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_06_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_06_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -769,21 +994,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -812,13 +1037,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_06_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -833,34 +1119,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_06_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_06_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfile """ @@ -899,6 +1186,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_06_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -917,9 +1236,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshPublicKey] """ @@ -937,6 +1256,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -946,9 +1271,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -965,6 +1290,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -976,8 +1306,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -998,6 +1328,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1028,6 +1362,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1054,6 +1390,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1071,10 +1409,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1099,6 +1437,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1114,61 +1458,61 @@ class ManagedCluster(Resource, BaseManagedCluster): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesIdentityProfileValue] :ivar id: Resource Id. :vartype id: str @@ -1176,12 +1520,12 @@ class ManagedCluster(Resource, BaseManagedCluster): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKU """ _validation = { @@ -1250,6 +1594,62 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPropertiesIdentityProfileValue] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1284,21 +1684,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1323,6 +1723,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1346,12 +1764,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1378,6 +1796,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1389,10 +1815,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAddonProfileIdentity @@ -1416,6 +1842,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1425,12 +1857,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1447,6 +1879,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1456,12 +1896,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1478,6 +1918,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1486,11 +1934,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1528,71 +1976,71 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :vartype orchestrator_version: str + :ivar node_image_version: Version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str """ _validation = { @@ -1655,6 +2103,112 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword node_image_version: Version of node image. + :paramtype node_image_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1689,11 +2243,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1731,74 +2285,74 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str - :param node_image_version: Version of node image. - :type node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :vartype orchestrator_version: str + :ivar node_image_version: Version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1864,6 +2418,115 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword node_image_version: Version of node image. + :paramtype node_image_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_06_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, node_image_version=node_image_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, **kwargs) self.name = name @@ -1871,10 +2534,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1889,6 +2552,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1905,17 +2574,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_06_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2020_06_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] """ @@ -1938,6 +2607,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedClusterIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_06_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1970,6 +2653,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -1980,8 +2665,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2001,6 +2686,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2009,27 +2698,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2057,6 +2745,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2069,9 +2780,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2088,6 +2799,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2095,8 +2811,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] """ @@ -2110,6 +2826,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2117,8 +2838,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] """ _attribute_map = { @@ -2131,6 +2852,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_06_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2140,15 +2865,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2173,6 +2898,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_06_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2183,10 +2920,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2201,6 +2938,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2209,24 +2952,24 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str """ _attribute_map = { @@ -2255,6 +2998,26 @@ def __init__( max_graceful_termination_sec: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.scan_interval = scan_interval @@ -2270,12 +3033,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -2292,6 +3055,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2300,10 +3071,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2322,6 +3093,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2330,10 +3107,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2348,6 +3125,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2366,12 +3149,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2398,6 +3181,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2411,22 +3203,22 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str + :vartype admin_password: str """ _validation = { @@ -2445,6 +3237,24 @@ def __init__( admin_password: Optional[str] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2471,6 +3281,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2516,6 +3328,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2528,8 +3342,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -2542,6 +3356,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -2561,11 +3379,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateLinkServiceConnectionState """ @@ -2592,6 +3410,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2020_06_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -2604,8 +3430,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -2618,6 +3444,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -2625,11 +3456,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_06_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2020_06_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -2644,6 +3475,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2020_06_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -2652,8 +3490,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2666,6 +3504,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2673,8 +3515,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2687,5 +3529,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py index d8b2c8f104a2..429b389a233f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py @@ -5,25 +5,255 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +277,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +295,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +304,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +348,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +382,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +407,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +458,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +485,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_06_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +510,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +536,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +575,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +596,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +621,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +640,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +672,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +697,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +726,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,4 +750,6 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py index 79597e85ac0a..29ccce2d2725 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +800,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +825,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +854,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +878,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +907,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +931,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +961,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +985,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1014,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1038,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1087,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1112,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1137,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1163,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1207,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1231,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1256,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1282,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1319,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1337,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1361,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1380,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1423,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1442,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1469,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1492,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1535,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1557,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1580,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1603,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-06-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1640,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1658,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1682,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,4 +1701,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py index 7612e5d092a9..f391c052055b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py index 940609124550..6f96b276d11b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-06-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py index a23663709ad8..f5cac242ed3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_container_service_client.py index 4c49ee53c923..18683c8889a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_container_service_client.py @@ -6,89 +6,90 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_07_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_07_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_07_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_07_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_07_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_07_01.operations.PrivateEndpointConnectionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json index 076bd3038b1f..b1f1e7a4e868 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py index efc93159e68c..25176e77e2f4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_container_service_client.py index fc82febbef22..89582d12be71 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_container_service_client.py @@ -6,85 +6,91 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_07_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_07_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_07_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_07_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_07_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_07_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_07_01.aio.operations.PrivateEndpointConnectionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py index c58fb19e26e5..1d12943d6718 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -633,15 +589,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -656,25 +616,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,4 +638,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py index e7fde1583765..5d604c435e65 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,4 +1177,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py index 480694353cca..685598257a35 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py index 8e63578c9cc4..614ec1c29f10 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py index 7e013a7f822d..542b46df1acc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py @@ -6,112 +6,59 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import BaseManagedCluster - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterIdentityUserAssignedIdentitiesValue - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import BaseManagedCluster # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import BaseManagedCluster +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterIdentityUserAssignedIdentitiesValue +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_container_service_client_enums.py index fc37a592f4a7..5afa2e6523a3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_container_service_client_enums.py @@ -6,41 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -49,7 +34,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -57,7 +42,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -236,7 +221,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -245,7 +230,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. """ @@ -253,62 +238,62 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -317,7 +302,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -328,7 +313,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -336,7 +321,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models.py deleted file mode 100644 index 7375431406e2..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models.py +++ /dev/null @@ -1,2435 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class BaseManagedCluster(msrest.serialization.Model): - """BaseManagedCluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(BaseManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_07_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_07_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_07_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_07_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, BaseManagedCluster): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesIdentityProfileValue] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_07_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedClusterIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedClusterIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable - Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.LicenseType - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_07_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2020_07_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_07_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py index 4da9513883fa..a4795adf8e2d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,11 +63,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -103,72 +105,72 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str """ _validation = { @@ -237,6 +239,111 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -275,8 +382,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -299,6 +406,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -309,12 +421,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -331,6 +443,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -342,8 +462,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -363,6 +483,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -381,17 +505,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -421,6 +545,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -434,10 +571,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -452,6 +589,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -460,9 +603,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -475,6 +618,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -484,61 +632,61 @@ class BaseManagedCluster(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -595,6 +743,56 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(BaseManagedCluster, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -622,17 +820,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_07_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_07_01.models.CloudErrorBody] """ _attribute_map = { @@ -651,6 +849,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_07_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -663,8 +874,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMDiagnostics """ @@ -682,6 +893,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -691,10 +907,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -714,6 +930,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -726,12 +949,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_07_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_07_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -769,21 +992,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -812,13 +1035,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_07_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -833,34 +1117,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_07_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_07_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfile """ @@ -899,6 +1184,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_07_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -917,9 +1234,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshPublicKey] """ @@ -937,6 +1254,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -946,9 +1269,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -965,6 +1288,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -976,8 +1304,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -998,6 +1326,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1028,6 +1360,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1054,6 +1388,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1071,10 +1407,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1099,6 +1435,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1114,61 +1456,61 @@ class ManagedCluster(Resource, BaseManagedCluster): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesIdentityProfileValue] :ivar id: Resource Id. :vartype id: str @@ -1176,12 +1518,12 @@ class ManagedCluster(Resource, BaseManagedCluster): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKU """ _validation = { @@ -1250,6 +1592,62 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPropertiesIdentityProfileValue] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1284,21 +1682,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1323,6 +1721,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1346,12 +1762,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1378,6 +1794,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1389,10 +1813,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAddonProfileIdentity @@ -1416,6 +1840,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1425,12 +1855,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1447,6 +1877,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1456,12 +1894,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1478,6 +1916,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1486,11 +1932,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1528,71 +1974,71 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str """ _validation = { @@ -1655,6 +2101,110 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1689,11 +2239,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1731,74 +2281,74 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1864,6 +2414,113 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_07_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, **kwargs) self.name = name @@ -1871,10 +2528,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1889,6 +2546,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1905,17 +2568,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_07_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2020_07_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] """ @@ -1938,6 +2601,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedClusterIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_07_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1970,6 +2647,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -1980,8 +2659,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2001,6 +2680,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2009,27 +2692,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2057,6 +2739,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2069,9 +2774,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2088,6 +2793,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2095,8 +2805,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] """ @@ -2110,6 +2820,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2117,8 +2832,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] """ _attribute_map = { @@ -2131,6 +2846,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_07_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2140,15 +2859,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2173,6 +2892,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2183,10 +2914,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2201,6 +2932,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2209,24 +2946,24 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str """ _attribute_map = { @@ -2255,6 +2992,26 @@ def __init__( max_graceful_termination_sec: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.scan_interval = scan_interval @@ -2270,12 +3027,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -2292,6 +3049,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2300,10 +3065,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2322,6 +3087,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2330,10 +3101,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2348,6 +3119,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2366,12 +3143,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2398,6 +3175,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2411,25 +3197,25 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + :vartype admin_password: str + :ivar license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.LicenseType + :vartype license_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.LicenseType """ _validation = { @@ -2450,6 +3236,27 @@ def __init__( license_type: Optional[Union[str, "LicenseType"]] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2020_07_01.models.LicenseType + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2477,6 +3284,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2522,6 +3331,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2534,8 +3345,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -2548,6 +3359,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -2567,11 +3382,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateLinkServiceConnectionState """ @@ -2598,6 +3413,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2020_07_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -2610,8 +3433,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -2624,6 +3447,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -2631,11 +3459,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_07_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2020_07_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -2650,6 +3478,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2020_07_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -2658,8 +3493,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2672,6 +3507,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2679,8 +3518,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2693,5 +3532,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py index 8a2b18493892..4b9da6ea3de3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +332,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +341,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +385,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +419,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +444,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +495,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +522,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +547,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +573,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +612,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +633,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +658,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +677,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +709,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +734,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrade node image version of an agent pool to the latest. Upgrade node image version of an agent pool to the latest. @@ -647,15 +854,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -670,25 +880,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,4 +902,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py index 4435bf5a3193..f8638a00b717 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py @@ -5,25 +5,550 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +572,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +594,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +634,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +654,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +665,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +707,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +739,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +763,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +800,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +825,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +854,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +878,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +907,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +931,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +961,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +985,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1014,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1038,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1087,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1112,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1137,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1163,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1207,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1231,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1256,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1282,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1319,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1337,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1361,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1380,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1423,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1442,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1469,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1492,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1535,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1557,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1580,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1603,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1640,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1658,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1682,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,4 +1701,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py index 25aa4ff2c3a6..d42ed8774219 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py index e873861ec435..cfaec32b0316 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py index 7016f7e6774d..8bec48ee1996 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_container_service_client.py index 9af2ef000947..17d1efe3bcb5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_container_service_client.py @@ -6,99 +6,98 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_09_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_09_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_09_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_09_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_09_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_09_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2020_09_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2020_09_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_09_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2020_09_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json index 304155a4e9f2..8b0317420317 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py index b36a0a9aed17..8d49bbf4c17a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_container_service_client.py index 2f5ee72ecf97..5b432c8459f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_container_service_client.py @@ -6,95 +6,99 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_09_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_09_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_09_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_09_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_09_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_09_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_09_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2020_09_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2020_09_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_09_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2020_09_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py index 7121bd6dd11f..609740c1c7c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 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_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 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._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -633,15 +589,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -656,25 +616,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,4 +638,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py index 3c96359082d7..bc5bbe74b79c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 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_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 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_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 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_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 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_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 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_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 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._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 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._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 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._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,6 +1177,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1286,27 +1191,17 @@ async def _stop_initial( 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._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1319,6 +1214,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1335,15 +1232,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1357,21 +1256,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1383,6 +1275,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1396,27 +1289,17 @@ async def _start_initial( 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._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1429,6 +1312,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1445,15 +1330,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1467,21 +1354,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1493,4 +1373,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py index 2e2b81990650..4b02d7e7ea85 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py index b60f69b046bc..6847ffbf9127 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py index a0ded34dea0f..6665cddaf23c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py index 9be4779ead50..652e316f2536 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -68,32 +73,22 @@ async def post( 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.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -107,4 +102,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py index 46fd65fb15c2..4b98050fe23e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py @@ -6,118 +6,62 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import BaseManagedCluster - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterIdentityUserAssignedIdentitiesValue - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import BaseManagedCluster # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterPropertiesIdentityProfileValue # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import BaseManagedCluster +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterIdentityUserAssignedIdentitiesValue +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_container_service_client_enums.py index 27ed4c7406fd..d99b1f1a529e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_container_service_client_enums.py @@ -6,48 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ RUNNING = "Running" STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -56,7 +41,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -64,7 +49,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -243,7 +228,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -252,13 +237,13 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LEAST_WASTE = "least-waste" MOST_PODS = "most-pods" RANDOM = "random" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. """ @@ -266,69 +251,69 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OSDiskType represents the type of an OS disk on an agent pool. """ MANAGED = "Managed" EPHEMERAL = "Ephemeral" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -337,7 +322,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -348,7 +333,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -356,7 +341,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models.py deleted file mode 100644 index b3e1c915e78d..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models.py +++ /dev/null @@ -1,2589 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. - Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class BaseManagedCluster(msrest.serialization.Model): - """BaseManagedCluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesIdentityProfileValue] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(BaseManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_09_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_09_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_09_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_09_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, BaseManagedCluster): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesIdentityProfileValue] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ManagedClusterPropertiesIdentityProfileValue}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. - Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. - Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_09_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedClusterIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedClusterIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "random". - :type expander: str or ~azure.mgmt.containerservice.v2020_09_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): - """ManagedClusterPropertiesIdentityProfileValue. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable - Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.LicenseType - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_09_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2020_09_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_09_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py index e03a520ece89..dd9fc97c3fd2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,11 +63,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -103,78 +105,78 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str """ _validation = { @@ -247,6 +249,115 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. + Possible values include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -287,8 +398,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -311,6 +422,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -321,12 +437,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -343,6 +459,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -354,8 +478,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -375,6 +499,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -393,17 +521,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -433,6 +561,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -446,10 +587,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -464,6 +605,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -472,9 +619,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -487,6 +634,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -496,8 +648,8 @@ class BaseManagedCluster(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -505,54 +657,54 @@ class BaseManagedCluster(msrest.serialization.Model): :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesIdentityProfileValue] """ @@ -611,6 +763,56 @@ def __init__( identity_profile: Optional[Dict[str, "ManagedClusterPropertiesIdentityProfileValue"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesIdentityProfileValue] + """ super(BaseManagedCluster, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -639,17 +841,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_09_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_09_01.models.CloudErrorBody] """ _attribute_map = { @@ -668,6 +870,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_09_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -680,8 +895,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMDiagnostics """ @@ -699,6 +914,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -708,10 +928,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -731,6 +951,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -743,12 +970,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_09_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_09_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -786,21 +1013,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -829,13 +1056,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_09_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -850,34 +1138,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_09_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_09_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfile """ @@ -916,6 +1205,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_09_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -934,9 +1255,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshPublicKey] """ @@ -954,6 +1275,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -963,9 +1290,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -982,6 +1309,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -993,8 +1325,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -1015,6 +1347,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1045,6 +1381,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1071,6 +1409,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1088,10 +1428,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1116,6 +1456,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1131,8 +1477,8 @@ class ManagedCluster(Resource, BaseManagedCluster): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -1140,54 +1486,54 @@ class ManagedCluster(Resource, BaseManagedCluster): :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfile] - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesIdentityProfileValue] :ivar id: Resource Id. :vartype id: str @@ -1195,12 +1541,12 @@ class ManagedCluster(Resource, BaseManagedCluster): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKU """ _validation = { @@ -1271,6 +1617,62 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfile] + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPropertiesIdentityProfileValue] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1306,21 +1708,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1345,6 +1747,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1368,12 +1788,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1400,6 +1820,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1411,10 +1839,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAddonProfileIdentity @@ -1438,6 +1866,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1447,12 +1881,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1469,6 +1903,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1478,12 +1920,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1500,6 +1942,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1508,11 +1958,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1550,77 +2000,77 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str """ _validation = { @@ -1687,6 +2137,114 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. + Possible values include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1723,11 +2281,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1765,80 +2323,80 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_09_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -1908,6 +2466,117 @@ def __init__( proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. Defaults to 'Managed'. May not be changed after creation. + Possible values include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_09_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, vnet_subnet_id=vnet_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, **kwargs) self.name = name @@ -1915,10 +2584,10 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool """ _attribute_map = { @@ -1933,6 +2602,12 @@ def __init__( enable_private_cluster: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -1949,17 +2624,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_09_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2020_09_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] """ @@ -1982,6 +2657,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedClusterIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_09_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2014,6 +2703,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -2024,8 +2715,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2045,6 +2736,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2053,27 +2748,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2101,6 +2795,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2113,9 +2830,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2132,6 +2849,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2139,8 +2861,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] """ @@ -2154,6 +2876,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2161,8 +2888,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] """ _attribute_map = { @@ -2175,6 +2902,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_09_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2184,15 +2915,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2217,6 +2948,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2227,10 +2970,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2245,6 +2988,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2253,38 +3002,38 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "random". - :type expander: str or ~azure.mgmt.containerservice.v2020_09_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar expander: Possible values include: "least-waste", "most-pods", "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2020_09_01.models.Expander + :ivar max_empty_bulk_delete: + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str + :ivar max_total_unready_percentage: + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: + :vartype ok_total_unready_count: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -2327,6 +3076,40 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword expander: Possible values include: "least-waste", "most-pods", "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2020_09_01.models.Expander + :keyword max_empty_bulk_delete: + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + :keyword max_total_unready_percentage: + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: + :paramtype ok_total_unready_count: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -2349,12 +3132,12 @@ def __init__( class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): """ManagedClusterPropertiesIdentityProfileValue. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -2371,6 +3154,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2379,10 +3170,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2401,6 +3192,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2409,10 +3206,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2427,6 +3224,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2445,12 +3248,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2477,6 +3280,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2490,25 +3302,25 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + :vartype admin_password: str + :ivar license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.LicenseType + :vartype license_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.LicenseType """ _validation = { @@ -2529,6 +3341,27 @@ def __init__( license_type: Optional[Union[str, "LicenseType"]] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2020_09_01.models.LicenseType + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2556,6 +3389,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2601,6 +3436,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2613,9 +3450,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2020_09_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2020_09_01.models.Code """ _attribute_map = { @@ -2628,6 +3465,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2020_09_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -2635,8 +3477,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -2649,6 +3491,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -2668,11 +3514,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkServiceConnectionState """ @@ -2699,6 +3545,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -2711,8 +3565,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -2725,6 +3579,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -2734,16 +3593,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -2772,6 +3631,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -2784,8 +3655,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource] """ _attribute_map = { @@ -2798,6 +3669,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -2805,11 +3680,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_09_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2020_09_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -2824,6 +3699,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2020_09_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -2832,8 +3714,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -2846,6 +3728,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -2853,8 +3739,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -2867,5 +3753,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py index 0f557b922bfb..2e3ccd51a616 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +332,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +341,33 @@ def list( 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +385,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +419,18 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +444,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +495,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +522,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +547,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +573,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +612,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +633,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +658,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +677,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +709,18 @@ def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +734,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 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_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] 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._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrade node image version of an agent pool to the latest. Upgrade node image version of an agent pool to the latest. @@ -647,15 +854,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -670,25 +880,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,4 +902,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py index 9588b4280b5c..56c8d3aa445c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py @@ -5,25 +5,620 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +642,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +664,29 @@ def list( 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +704,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +724,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +735,31 @@ def list_by_resource_group( 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +777,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +809,17 @@ def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +833,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +870,18 @@ def get_access_profile( 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_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +895,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +924,17 @@ def list_cluster_admin_credentials( 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_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +948,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +977,17 @@ def list_cluster_user_credentials( 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_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +1001,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +1031,17 @@ def list_cluster_monitoring_user_credentials( 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_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +1055,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1084,17 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1108,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1157,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1182,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1207,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1233,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] 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_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1277,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1301,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1326,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1352,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1389,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1407,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1431,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1450,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1493,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1512,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1539,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1562,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1605,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1627,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1650,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1673,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1710,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1728,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1752,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,41 +1771,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1344,13 +1808,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stop Managed Cluster. Stops a Running Managed Cluster. @@ -1361,15 +1826,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1383,21 +1850,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1409,41 +1869,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1456,13 +1906,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Start Managed Cluster. Starts a Stopped Managed Cluster. @@ -1473,15 +1924,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1495,21 +1948,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1521,4 +1967,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py index c9666013be69..0785c8b1ce78 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py index 9bad5e24e3b8..ab4b1d734ff9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py index 2f52546540a9..0a5415f17592 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. Gets a list of private link resources in the specified managed cluster. The operation returns @@ -70,27 +107,17 @@ def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py index ee09a3ebae9e..fe3dca6d31fc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID the specified managed cluster. @@ -73,32 +120,22 @@ def post( 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.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -112,4 +149,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py index eb4774624524..272563bb4f04 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py index c02eb1438f93..b98b0073b134 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_container_service_client.py @@ -6,99 +6,98 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_11_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_11_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_11_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_11_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_11_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_11_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2020_11_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2020_11_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_11_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2020_11_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json index 13ae430b21bf..f6c100234a11 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py index aa250c6ba1d6..096c27ae14af 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py index ad0961b95582..2f003093b474 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_container_service_client.py @@ -6,95 +6,99 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_11_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_11_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_11_01.aio.operations.ManagedClustersOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_11_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_11_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_11_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_11_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2020_11_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2020_11_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_11_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2020_11_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py index 301b72164b13..6c804da64425 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -633,15 +589,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -656,25 +616,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,4 +638,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py index 56df5ad96610..b0c905aff7a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,6 +1177,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1286,27 +1191,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1319,6 +1214,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1335,15 +1232,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1357,21 +1256,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1383,6 +1275,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1396,27 +1289,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1429,6 +1312,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1445,15 +1330,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1467,21 +1354,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1493,4 +1373,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py index e45649a540d1..d134a5be4ecb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py index d3e062d376cb..3bdc0d35bbac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # 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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py index 0ef87c7f6588..1023adad78db 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py index 4d014c40a741..7f05078726bb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -68,32 +73,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -107,4 +102,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/__init__.py index eb2cdef3da47..a12fd51d8174 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/__init__.py @@ -6,136 +6,71 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudError - from ._models_py3 import CloudErrorBody - from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 - from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import TagsObject - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudError # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import Components1Q1Og48SchemasManagedclusterAllof1 # type: ignore - from ._models import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import TagsObject # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudError +from ._models_py3 import CloudErrorBody +from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 +from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties +from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import TagsObject +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_container_service_client_enums.py index a602a54ecbdf..c3452f896bfa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_container_service_client_enums.py @@ -6,48 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ RUNNING = "Running" STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -56,7 +41,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -64,7 +49,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -243,7 +228,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -252,13 +237,13 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LEAST_WASTE = "least-waste" MOST_PODS = "most-pods" RANDOM = "random" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. """ @@ -266,14 +251,14 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -282,62 +267,62 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OSDiskType represents the type of an OS disk on an agent pool. """ MANAGED = "Managed" EPHEMERAL = "Ephemeral" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -346,7 +331,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -357,7 +342,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -365,14 +350,14 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ SPOT = "Spot" REGULAR = "Regular" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """upgrade channel for auto upgrade. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models.py deleted file mode 100644 index 3fdf8440b368..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models.py +++ /dev/null @@ -1,3037 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudError(msrest.serialization.Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): - """Components1Q1Og48SchemasManagedclusterAllof1. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): - """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(**kwargs) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_11_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_11_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_11_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class KubeletConfig(msrest.serialization.Model): - """Kubelet configurations of agent nodes. - - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection - is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection - is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - """ - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """OS configurations of Linux agent nodes. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2020_11_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on - each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", - "stable", "patch", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2020_11_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_11_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """ManagedClusterPodIdentity. - - Variables are only 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 name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2020_11_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """ManagedClusterPodIdentityException. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """ManagedClusterPodIdentityProfile. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "random". - :type expander: str or ~azure.mgmt.containerservice.v2020_11_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable - Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.LicenseType - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_11_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2020_11_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_11_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_rmem: Sysctl setting net.ipv4.tcp_rmem. - :type net_ipv4_tcp_rmem: int - :param net_ipv4_tcp_wmem: Sysctl setting net.ipv4.tcp_wmem. - :type net_ipv4_tcp_wmem: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_rmem': {'key': 'netIpv4TcpRmem', 'type': 'int'}, - 'net_ipv4_tcp_wmem': {'key': 'netIpv4TcpWmem', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_rmem = kwargs.get('net_ipv4_tcp_rmem', None) - self.net_ipv4_tcp_wmem = kwargs.get('net_ipv4_tcp_wmem', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', None) - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py index 8972e36ac26b..c6dc03b32347 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/models/_models_py3.py @@ -43,6 +43,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -61,11 +63,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -103,87 +105,87 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig """ _validation = { @@ -262,6 +264,124 @@ def __init__( linux_os_config: Optional["LinuxOSConfig"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -305,8 +425,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -329,6 +449,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -339,12 +464,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -361,6 +486,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -372,8 +505,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -393,6 +526,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -411,17 +548,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -451,6 +588,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -464,10 +614,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -482,6 +632,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -490,9 +646,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -505,6 +661,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -512,8 +673,8 @@ def __init__( class CloudError(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody """ _attribute_map = { @@ -526,6 +687,10 @@ def __init__( error: Optional["CloudErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody + """ super(CloudError, self).__init__(**kwargs) self.error = error @@ -533,17 +698,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody] """ _attribute_map = { @@ -562,6 +727,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_11_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -574,8 +752,8 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -583,60 +761,60 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] """ @@ -699,6 +877,62 @@ def __init__( identity_profile: Optional[Dict[str, "ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + """ super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -751,6 +985,8 @@ def __init__( self, **kwargs ): + """ + """ super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -759,12 +995,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -781,6 +1017,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -790,12 +1034,12 @@ def __init__( class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -812,6 +1056,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -820,8 +1072,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMDiagnostics """ @@ -839,6 +1091,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -848,10 +1105,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -871,6 +1128,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -883,12 +1147,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_11_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_11_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -926,21 +1190,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -969,13 +1233,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_11_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -990,34 +1315,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_11_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_11_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfile """ @@ -1056,6 +1382,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_11_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -1074,9 +1432,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshPublicKey] """ @@ -1094,6 +1452,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -1103,9 +1467,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -1122,6 +1486,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -1133,8 +1502,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -1155,6 +1524,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1185,6 +1558,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1211,6 +1586,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1218,26 +1595,26 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """Kubelet configurations of agent nodes. - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection + :ivar cpu_manager_policy: CPU Manager policy to use. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: Sets CPU CFS quota period value. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: The percent of disk usage after which image garbage collection is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: The percent of disk usage before which image garbage collection is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: Topology Manager policy to use. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool """ _attribute_map = { @@ -1264,6 +1641,29 @@ def __init__( fail_swap_on: Optional[bool] = None, **kwargs ): + """ + :keyword cpu_manager_policy: CPU Manager policy to use. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU + limits. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: Sets CPU CFS quota period value. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: The percent of disk usage after which image garbage + collection is always run. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: The percent of disk usage before which image garbage + collection is never run. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: Topology Manager policy to use. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1278,15 +1678,15 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """OS configurations of Linux agent nodes. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2020_11_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2020_11_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on each node. - :type swap_file_size_mb: int + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1305,6 +1705,17 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2020_11_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created + on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1325,10 +1736,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1353,6 +1764,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1368,8 +1785,8 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -1377,60 +1794,60 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] :ivar id: Resource Id. :vartype id: str @@ -1438,12 +1855,12 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKU """ _validation = { @@ -1518,6 +1935,68 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_11_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, pod_identity_profile=pod_identity_profile, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_upgrade_profile=auto_upgrade_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1555,21 +2034,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1594,6 +2073,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1617,12 +2114,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1649,6 +2146,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1660,10 +2165,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAddonProfileIdentity @@ -1687,6 +2192,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1696,12 +2207,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1718,6 +2229,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1726,11 +2245,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1768,86 +2287,86 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig """ _validation = { @@ -1920,6 +2439,123 @@ def __init__( linux_os_config: Optional["LinuxOSConfig"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1959,11 +2595,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -2001,89 +2637,89 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_11_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -2159,6 +2795,126 @@ def __init__( linux_os_config: Optional["LinuxOSConfig"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_11_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2020_11_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2020_11_01.models.LinuxOSConfig + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, **kwargs) self.name = name @@ -2166,12 +2922,12 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: Private dns zone mode for private cluster. + :vartype private_dns_zone: str """ _attribute_map = { @@ -2188,6 +2944,14 @@ def __init__( private_dns_zone: Optional[str] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: Private dns zone mode for private cluster. + :paramtype private_dns_zone: str + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2197,9 +2961,9 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + :ivar upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", "stable", "patch", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2020_11_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2020_11_01.models.UpgradeChannel """ _attribute_map = { @@ -2212,6 +2976,12 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + "stable", "patch", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2020_11_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2227,17 +2997,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_11_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2020_11_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ @@ -2260,6 +3030,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_11_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2020_11_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2272,8 +3056,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2293,6 +3077,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2301,27 +3089,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2349,6 +3136,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2361,9 +3171,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2380,6 +3190,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2387,8 +3202,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] """ @@ -2402,6 +3217,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2409,8 +3229,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] """ _attribute_map = { @@ -2423,6 +3243,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_11_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2434,12 +3258,12 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2020_11_01.models.UserAssignedIdentity + :ivar name: Required. Name of the pod identity. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity. + :vartype namespace: str + :ivar identity: Required. Information of the user assigned identity. + :vartype identity: ~azure.mgmt.containerservice.v2020_11_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2473,6 +3297,14 @@ def __init__( identity: "UserAssignedIdentity", **kwargs ): + """ + :keyword name: Required. Name of the pod identity. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity. + :paramtype namespace: str + :keyword identity: Required. Information of the user assigned identity. + :paramtype identity: ~azure.mgmt.containerservice.v2020_11_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2486,12 +3318,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. Name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. Pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2514,6 +3346,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. Name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. Pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2523,13 +3363,13 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """ManagedClusterPodIdentityProfile. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar user_assigned_identities: User assigned pod identity settings. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: User assigned pod identity exception settings. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityException] """ @@ -2547,6 +3387,16 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword user_assigned_identities: User assigned pod identity settings. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: User assigned pod identity exception settings. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.user_assigned_identities = user_assigned_identities @@ -2556,8 +3406,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudError + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudError """ _attribute_map = { @@ -2570,6 +3420,10 @@ def __init__( error: Optional["CloudError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: ~azure.mgmt.containerservice.v2020_11_01.models.CloudError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2579,15 +3433,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2612,6 +3466,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2622,10 +3488,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2640,6 +3506,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2648,38 +3520,38 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "random". - :type expander: str or ~azure.mgmt.containerservice.v2020_11_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar expander: Possible values include: "least-waste", "most-pods", "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2020_11_01.models.Expander + :ivar max_empty_bulk_delete: + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str + :ivar max_total_unready_percentage: + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: + :vartype ok_total_unready_count: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -2722,6 +3594,40 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword expander: Possible values include: "least-waste", "most-pods", "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2020_11_01.models.Expander + :keyword max_empty_bulk_delete: + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + :keyword max_total_unready_percentage: + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: + :paramtype ok_total_unready_count: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -2746,10 +3652,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2768,6 +3674,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2776,10 +3688,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2794,6 +3706,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2812,12 +3730,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2844,6 +3762,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2857,25 +3784,25 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + :vartype admin_password: str + :ivar license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.LicenseType + :vartype license_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.LicenseType """ _validation = { @@ -2896,6 +3823,27 @@ def __init__( license_type: Optional[Union[str, "LicenseType"]] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2020_11_01.models.LicenseType + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -2923,6 +3871,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -2968,6 +3918,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2980,9 +3932,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2020_11_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2020_11_01.models.Code """ _attribute_map = { @@ -2995,6 +3947,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2020_11_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3002,8 +3959,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -3016,6 +3973,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3035,11 +3996,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkServiceConnectionState """ @@ -3066,6 +4027,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3078,8 +4047,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3092,6 +4061,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3101,16 +4075,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3139,6 +4113,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3151,8 +4137,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3165,6 +4151,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3172,11 +4162,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_11_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2020_11_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3191,6 +4181,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2020_11_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3199,8 +4196,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3213,6 +4210,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3220,62 +4221,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_rmem: Sysctl setting net.ipv4.tcp_rmem. - :type net_ipv4_tcp_rmem: int - :param net_ipv4_tcp_wmem: Sysctl setting net.ipv4.tcp_wmem. - :type net_ipv4_tcp_wmem: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_rmem: Sysctl setting net.ipv4.tcp_rmem. + :vartype net_ipv4_tcp_rmem: int + :ivar net_ipv4_tcp_wmem: Sysctl setting net.ipv4.tcp_wmem. + :vartype net_ipv4_tcp_wmem: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -3342,6 +4343,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_rmem: Sysctl setting net.ipv4.tcp_rmem. + :paramtype net_ipv4_tcp_rmem: int + :keyword net_ipv4_tcp_wmem: Sysctl setting net.ipv4.tcp_wmem. + :paramtype net_ipv4_tcp_wmem: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -3376,8 +4435,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3390,5 +4449,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py index d9a08ea6974f..bd56b3b1088e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +332,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +341,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +385,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +419,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +444,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +495,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +522,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +547,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +573,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +612,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +633,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +658,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +677,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +709,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +734,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrade node image version of an agent pool to the latest. Upgrade node image version of an agent pool to the latest. @@ -647,15 +854,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -670,25 +880,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,4 +902,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py index 6195140bd8cd..b1ff2ab80bab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_managed_clusters_operations.py @@ -5,25 +5,620 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +642,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +664,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +704,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +724,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +735,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +777,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +809,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +833,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +870,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +895,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +924,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +948,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +977,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +1001,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +1031,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +1055,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1084,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1108,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1157,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1182,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1207,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1233,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1277,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1301,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1326,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1352,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1389,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1407,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1431,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1450,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1493,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1512,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1539,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1562,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1605,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1627,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1650,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1673,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1710,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1728,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1752,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,41 +1771,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1344,13 +1808,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stop Managed Cluster. Stops a Running Managed Cluster. @@ -1361,15 +1826,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1383,21 +1850,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1409,41 +1869,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1456,13 +1906,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Start Managed Cluster. Starts a Stopped Managed Cluster. @@ -1473,15 +1924,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1495,21 +1948,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1521,4 +1967,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py index 65363484fcce..d46706b6f026 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py index 07d600df0d06..b12b86043cbf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # 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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py index 829fcbc7dae7..ec9763b3feea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. Gets a list of private link resources in the specified managed cluster. The operation returns @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py index 27ddbd6cf502..137c16a0f074 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID the specified managed cluster. @@ -73,32 +120,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -112,4 +149,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py index df9ec3d69a19..1dabb599d592 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_container_service_client.py index 99757c3b1606..b29e9bf066dd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_container_service_client.py @@ -6,104 +6,102 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_12_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_12_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_12_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2020_12_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2020_12_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_12_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_12_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_12_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2020_12_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2020_12_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_12_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2020_12_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_metadata.json index 644147f38501..4c227b1b1256 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py index f1409a83c252..45ec14b04443 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_container_service_client.py index 886a31c0e7be..10b33ad3bcd3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_container_service_client.py @@ -6,100 +6,103 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_12_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2020_12_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2020_12_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2020_12_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2020_12_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2020_12_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2020_12_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2020_12_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2020_12_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2020_12_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2020_12_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2020_12_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2020_12_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py index 44c927942f07..9be713407b9d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 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_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 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._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -633,15 +589,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -656,25 +616,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,4 +638,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py index 2093362e5e0a..222064491ff7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -57,8 +63,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -66,36 +74,33 @@ def list_by_managed_cluster( 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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -145,28 +152,18 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -180,8 +177,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -213,33 +213,23 @@ async def create_or_update( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -253,8 +243,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -282,28 +275,18 @@ async def delete( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -315,3 +298,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py index 5632558d944e..a24a6194fa16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 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_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 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_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 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_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 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_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 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_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 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._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 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._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 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._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,6 +1177,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1286,27 +1191,17 @@ async def _stop_initial( 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._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1319,6 +1214,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1335,15 +1232,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1357,21 +1256,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1383,6 +1275,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1396,27 +1289,17 @@ async def _start_initial( 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._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1429,6 +1312,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1445,15 +1330,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1467,21 +1354,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1493,4 +1373,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py index b667836960f6..eefea53a6b04 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py index 3571ebaa53be..f4c38f79bdb4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py index c61ba658b051..7f013a620588 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py index bbaa926aee3a..65d8db29cdd8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -68,32 +73,22 @@ async def post( 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.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -107,4 +102,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/__init__.py index c0c6aed90fb8..9e976fe25bb3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/__init__.py @@ -6,146 +6,76 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudError - from ._models_py3 import CloudErrorBody - from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 - from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudError # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import Components1Q1Og48SchemasManagedclusterAllof1 # type: ignore - from ._models import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudError +from ._models_py3 import CloudErrorBody +from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 +from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties +from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_container_service_client_enums.py index 778943036444..4188985eff74 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_container_service_client_enums.py @@ -6,48 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ RUNNING = "Running" STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -56,7 +41,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -64,7 +49,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -243,7 +228,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -252,7 +237,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -261,14 +246,14 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LEAST_WASTE = "least-waste" MOST_PODS = "most-pods" PRIORITY = "priority" RANDOM = "random" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. @@ -276,7 +261,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OS = "OS" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. """ @@ -284,14 +269,14 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -300,62 +285,62 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OSDiskType represents the type of an OS disk on an agent pool. """ MANAGED = "Managed" EPHEMERAL = "Ephemeral" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -364,7 +349,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -375,7 +360,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -383,14 +368,14 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ SPOT = "Spot" REGULAR = "Regular" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """upgrade channel for auto upgrade. """ @@ -399,7 +384,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PATCH = "patch" NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models.py deleted file mode 100644 index 27b37a8358b6..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models.py +++ /dev/null @@ -1,3251 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudError(msrest.serialization.Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): - """Components1Q1Og48SchemasManagedclusterAllof1. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_12_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): - """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(**kwargs) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_12_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_12_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_12_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class KubeletConfig(msrest.serialization.Model): - """Kubelet configurations of agent nodes. - - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection - is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection - is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """OS configurations of Linux agent nodes. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2020_12_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on - each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """maintenance configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2020_12_01.models.SystemData - :param time_in_week: Weekday time slots allowed to upgrade. - :type time_in_week: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2020_12_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn = None - self.private_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", - "stable", "patch", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2020_12_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_12_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2020_12_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """ManagedClusterPodIdentity. - - Variables are only 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 name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2020_12_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """ManagedClusterPodIdentityException. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """ManagedClusterPodIdentityProfile. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2020_12_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_node_provision_time: - :type max_node_provision_time: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable - Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.LicenseType - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2020_12_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2020_12_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_12_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.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.containerservice.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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2020_12_01.models.WeekDay - :param hour_slots: hour slots in a day. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """The time span with start and end properties. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py index 2b54a24fe948..b999745c0e55 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,11 +64,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -104,93 +106,94 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool """ _validation = { @@ -273,6 +276,131 @@ def __init__( enable_encryption_at_host: Optional[bool] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -318,8 +446,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -342,6 +470,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -352,12 +485,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -374,6 +507,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -385,8 +526,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -406,6 +547,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -424,17 +569,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -464,6 +609,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -477,10 +635,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -495,6 +653,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -503,9 +667,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -518,6 +682,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -525,8 +694,8 @@ def __init__( class CloudError(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody """ _attribute_map = { @@ -539,6 +708,10 @@ def __init__( error: Optional["CloudErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody + """ super(CloudError, self).__init__(**kwargs) self.error = error @@ -546,17 +719,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody] """ _attribute_map = { @@ -575,6 +748,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2020_12_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -587,8 +773,8 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -596,60 +782,60 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_12_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] """ @@ -712,6 +898,62 @@ def __init__( identity_profile: Optional[Dict[str, "ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_12_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + """ super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -764,6 +1006,8 @@ def __init__( self, **kwargs ): + """ + """ super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -772,12 +1016,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -794,6 +1038,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -803,12 +1055,12 @@ def __init__( class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -825,6 +1077,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -833,8 +1093,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMDiagnostics """ @@ -852,6 +1112,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -861,10 +1126,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -884,6 +1149,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -896,12 +1168,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2020_12_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2020_12_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -939,21 +1211,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -982,13 +1254,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2020_12_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -1003,34 +1336,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2020_12_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_12_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfile """ @@ -1069,6 +1403,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2020_12_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -1087,9 +1453,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshPublicKey] """ @@ -1107,6 +1473,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -1116,9 +1488,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -1135,6 +1507,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -1146,8 +1523,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -1168,6 +1545,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1198,6 +1579,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1224,6 +1607,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1231,34 +1616,34 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """Kubelet configurations of agent nodes. - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection + :ivar cpu_manager_policy: CPU Manager policy to use. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: Sets CPU CFS quota period value. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: The percent of disk usage after which image garbage collection is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: The percent of disk usage before which image garbage collection is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: Topology Manager policy to use. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1295,6 +1680,37 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: CPU Manager policy to use. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU + limits. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: Sets CPU CFS quota period value. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: The percent of disk usage after which image garbage + collection is always run. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: The percent of disk usage before which image garbage + collection is never run. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: Topology Manager policy to use. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1312,15 +1728,15 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """OS configurations of Linux agent nodes. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2020_12_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2020_12_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on each node. - :type swap_file_size_mb: int + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1339,6 +1755,17 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2020_12_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created + on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1360,10 +1787,10 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2020_12_01.models.SystemData - :param time_in_week: Weekday time slots allowed to upgrade. - :type time_in_week: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeSpan] + :ivar time_in_week: Weekday time slots allowed to upgrade. + :vartype time_in_week: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeSpan] """ _validation = { @@ -1389,6 +1816,12 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: Weekday time slots allowed to upgrade. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2020_12_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1400,8 +1833,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1421,6 +1854,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1439,10 +1877,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1467,6 +1905,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1482,8 +1926,8 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -1491,60 +1935,60 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2020_12_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] :ivar id: Resource Id. :vartype id: str @@ -1552,12 +1996,12 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKU """ _validation = { @@ -1632,6 +2076,68 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2020_12_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, pod_identity_profile=pod_identity_profile, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_upgrade_profile=auto_upgrade_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1669,21 +2175,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1708,6 +2214,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1731,12 +2255,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1763,6 +2287,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1774,10 +2306,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAddonProfileIdentity @@ -1801,6 +2333,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1810,12 +2348,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1832,6 +2370,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1840,11 +2386,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1882,92 +2428,93 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool """ _validation = { @@ -2044,6 +2591,130 @@ def __init__( enable_encryption_at_host: Optional[bool] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2085,11 +2756,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -2127,95 +2798,96 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2020_12_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -2295,6 +2967,133 @@ def __init__( enable_encryption_at_host: Optional[bool] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2020_12_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2020_12_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2020_12_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, **kwargs) self.name = name @@ -2302,12 +3101,12 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: Private dns zone mode for private cluster. + :vartype private_dns_zone: str """ _attribute_map = { @@ -2324,6 +3123,14 @@ def __init__( private_dns_zone: Optional[str] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: Private dns zone mode for private cluster. + :paramtype private_dns_zone: str + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2333,9 +3140,9 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + :ivar upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", "stable", "patch", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2020_12_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2020_12_01.models.UpgradeChannel """ _attribute_map = { @@ -2348,6 +3155,12 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + "stable", "patch", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2020_12_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2363,17 +3176,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2020_12_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2020_12_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2020_12_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ @@ -2396,6 +3209,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2020_12_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2020_12_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2408,8 +3235,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2429,6 +3256,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2437,27 +3268,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2485,6 +3315,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2497,9 +3350,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2516,6 +3369,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2523,8 +3381,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] """ @@ -2538,6 +3396,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2545,8 +3408,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] """ _attribute_map = { @@ -2559,6 +3422,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2020_12_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2570,12 +3437,12 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2020_12_01.models.UserAssignedIdentity + :ivar name: Required. Name of the pod identity. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity. + :vartype namespace: str + :ivar identity: Required. Information of the user assigned identity. + :vartype identity: ~azure.mgmt.containerservice.v2020_12_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2609,6 +3476,14 @@ def __init__( identity: "UserAssignedIdentity", **kwargs ): + """ + :keyword name: Required. Name of the pod identity. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity. + :paramtype namespace: str + :keyword identity: Required. Information of the user assigned identity. + :paramtype identity: ~azure.mgmt.containerservice.v2020_12_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2622,12 +3497,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. Name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. Pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2650,6 +3525,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. Name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. Pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2659,13 +3542,13 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """ManagedClusterPodIdentityProfile. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar user_assigned_identities: User assigned pod identity settings. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: User assigned pod identity exception settings. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityException] """ @@ -2683,6 +3566,16 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword user_assigned_identities: User assigned pod identity settings. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: User assigned pod identity exception settings. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.user_assigned_identities = user_assigned_identities @@ -2692,8 +3585,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudError + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudError """ _attribute_map = { @@ -2706,6 +3599,10 @@ def __init__( error: Optional["CloudError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: ~azure.mgmt.containerservice.v2020_12_01.models.CloudError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2715,15 +3612,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2748,6 +3645,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2758,10 +3667,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2776,6 +3685,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2784,40 +3699,40 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2020_12_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_node_provision_time: - :type max_node_provision_time: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar expander: Possible values include: "least-waste", "most-pods", "priority", "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2020_12_01.models.Expander + :ivar max_empty_bulk_delete: + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: + :vartype ok_total_unready_count: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -2862,6 +3777,42 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword expander: Possible values include: "least-waste", "most-pods", "priority", "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2020_12_01.models.Expander + :keyword max_empty_bulk_delete: + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: + :paramtype ok_total_unready_count: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -2887,10 +3838,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2909,6 +3860,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2917,10 +3874,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2935,6 +3892,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2953,12 +3916,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -2985,6 +3948,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -2998,25 +3970,25 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + :vartype admin_password: str + :ivar license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.LicenseType + :vartype license_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.LicenseType """ _validation = { @@ -3037,6 +4009,27 @@ def __init__( license_type: Optional[Union[str, "LicenseType"]] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.LicenseType + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3064,6 +4057,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3109,6 +4104,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3121,9 +4118,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2020_12_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2020_12_01.models.Code """ _attribute_map = { @@ -3136,6 +4133,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2020_12_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3143,8 +4145,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -3157,6 +4159,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3176,11 +4182,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkServiceConnectionState """ @@ -3207,6 +4213,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3219,8 +4233,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3233,6 +4247,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3242,16 +4261,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3280,6 +4299,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3292,8 +4323,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3306,6 +4337,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3313,11 +4348,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2020_12_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2020_12_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3332,6 +4367,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2020_12_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3340,8 +4382,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3354,6 +4396,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3361,62 +4407,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -3483,6 +4529,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -3517,21 +4621,21 @@ def __init__( 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.containerservice.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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2020_12_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -3554,6 +4658,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2020_12_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -3566,8 +4688,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3580,6 +4702,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -3587,11 +4713,11 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2020_12_01.models.WeekDay - :param hour_slots: hour slots in a day. - :type hour_slots: list[int] + :vartype day: str or ~azure.mgmt.containerservice.v2020_12_01.models.WeekDay + :ivar hour_slots: hour slots in a day. + :vartype hour_slots: list[int] """ _attribute_map = { @@ -3606,6 +4732,13 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2020_12_01.models.WeekDay + :keyword hour_slots: hour slots in a day. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -3614,10 +4747,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """The time span with start and end properties. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -3632,6 +4765,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py index d5e36d9ff138..351b2f8b0e4a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +332,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +341,33 @@ def list( 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +385,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +419,18 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +444,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +495,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +522,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +547,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +573,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +612,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +633,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +658,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +677,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +709,18 @@ def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +734,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 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_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] 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._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrade node image version of an agent pool to the latest. Upgrade node image version of an agent pool to the latest. @@ -647,15 +854,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -670,25 +880,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,4 +902,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py index 0d7f59ca5571..a61488a4adf7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. The operation @@ -62,8 +220,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -71,36 +231,33 @@ def list_by_managed_cluster( 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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,19 +275,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the maintenance configuration. Gets the details of maintenance configurations by managed cluster and resource group. @@ -151,28 +309,18 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -186,17 +334,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configurations. Creates or updates a maintenance configuration in the specified managed cluster. @@ -220,33 +370,23 @@ def create_or_update( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -260,16 +400,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes the maintenance configuration in the specified managed cluster. @@ -290,28 +432,18 @@ def delete( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -323,3 +455,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py index e424b7722048..df957373fa46 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py @@ -5,25 +5,620 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +642,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +664,29 @@ def list( 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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +704,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +724,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +735,31 @@ def list_by_resource_group( 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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +777,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +809,17 @@ def get_upgrade_profile( 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_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +833,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +870,18 @@ def get_access_profile( 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_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +895,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +924,17 @@ def list_cluster_admin_credentials( 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_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +948,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +977,17 @@ def list_cluster_user_credentials( 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_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +1001,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +1031,17 @@ def list_cluster_monitoring_user_credentials( 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_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +1055,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1084,17 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1108,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1157,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1182,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1207,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1233,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] 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_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1277,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1301,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1326,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1352,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1389,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1407,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1431,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1450,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1493,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1512,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1539,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1562,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1605,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1627,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1650,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1673,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1710,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1728,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1752,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,41 +1771,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1344,13 +1808,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stop Managed Cluster. Stops a Running Managed Cluster. @@ -1361,15 +1826,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1383,21 +1850,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1409,41 +1869,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1456,13 +1906,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Start Managed Cluster. Starts a Stopped Managed Cluster. @@ -1473,15 +1924,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1495,21 +1948,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1521,4 +1967,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py index d49593528c76..5216a602d4ae 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2020_12_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py index 2fafddf90524..d138fafe88d1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py index e61301522a10..4d05481df43d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. Gets a list of private link resources in the specified managed cluster. The operation returns @@ -70,27 +107,17 @@ def list( 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.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py index c89c87d67a7f..59e6fe73a160 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-12-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID the specified managed cluster. @@ -73,32 +120,22 @@ def post( 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.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -112,4 +149,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py index 65da788dad30..fdec5a474b7c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_container_service_client.py index be125a8e9551..14a89ae5ce83 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_container_service_client.py @@ -6,104 +6,102 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_02_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_02_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_02_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_02_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_02_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_02_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_02_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_02_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_02_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_02_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_02_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_02_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_metadata.json index 9f5ff3094d79..14a39eb88cee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py index 707b6013008e..3040e7a493bc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_container_service_client.py index bf69044c6d2d..86849db68f09 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_container_service_client.py @@ -6,100 +6,103 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_02_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_02_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_02_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_02_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_02_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_02_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_02_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_02_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_02_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_02_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_02_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_02_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_02_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py index 975b1fb91d94..746a5936b001 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -633,15 +589,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -656,25 +616,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,4 +638,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py index 82cfe2c538e5..a963850a753b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -57,8 +63,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -66,36 +74,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -145,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -180,8 +177,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -213,33 +213,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -253,8 +243,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -282,28 +275,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -315,3 +298,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py index 5c467d62f8cd..df544416365a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,8 +59,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -62,34 +70,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -107,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -125,8 +130,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -134,35 +141,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +183,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -210,27 +215,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -244,8 +239,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -278,28 +276,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,8 +301,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -339,27 +330,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -373,8 +354,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -399,27 +383,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -433,8 +407,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -460,27 +437,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +461,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -520,27 +490,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -554,8 +514,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -568,32 +530,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -611,8 +563,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -633,15 +588,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -653,27 +613,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -685,6 +639,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -699,32 +654,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -738,8 +683,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -759,15 +707,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -779,27 +732,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -811,6 +758,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -824,27 +772,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -857,6 +795,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -873,15 +813,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -895,21 +837,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,6 +856,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -935,32 +871,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -973,6 +899,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -990,18 +918,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1013,24 +945,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1042,6 +968,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1056,32 +983,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1094,6 +1011,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1114,15 +1033,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1134,24 +1056,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1163,6 +1079,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1176,27 +1093,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1209,6 +1116,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1225,15 +1134,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1247,21 +1158,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1273,6 +1177,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1286,27 +1191,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1319,6 +1214,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1335,15 +1232,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1357,21 +1256,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1383,6 +1275,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1396,27 +1289,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1429,6 +1312,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1445,15 +1330,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1467,21 +1354,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1493,4 +1373,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py index 09097b82f979..7594142e51b6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py index e7d9851003f8..ffc5771b3d20 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py index b8487924c2a3..aa3ff0c688e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py index 305883969cbd..93c92d2a48d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -68,32 +73,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -107,4 +102,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/__init__.py index c0c6aed90fb8..9e976fe25bb3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/__init__.py @@ -6,146 +6,76 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudError - from ._models_py3 import CloudErrorBody - from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 - from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudError # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import Components1Q1Og48SchemasManagedclusterAllof1 # type: ignore - from ._models import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudError +from ._models_py3 import CloudErrorBody +from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 +from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties +from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_container_service_client_enums.py index 6b71cdee9145..8c8738579bf0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_container_service_client_enums.py @@ -6,48 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ RUNNING = "Running" STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -56,7 +41,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -64,7 +49,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -243,7 +228,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -252,7 +237,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -261,14 +246,14 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LEAST_WASTE = "least-waste" MOST_PODS = "most-pods" PRIORITY = "priority" RANDOM = "random" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Allowed values: 'OS', 'Temporary' (preview). """ @@ -276,7 +261,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OS = "OS" TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. """ @@ -284,14 +269,14 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -300,62 +285,62 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OSDiskType represents the type of an OS disk on an agent pool. """ MANAGED = "Managed" EPHEMERAL = "Ephemeral" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -364,7 +349,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -375,7 +360,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -383,14 +368,14 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ SPOT = "Spot" REGULAR = "Regular" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """upgrade channel for auto upgrade. """ @@ -399,7 +384,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PATCH = "patch" NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models.py deleted file mode 100644 index 38867a0ffcfb..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models.py +++ /dev/null @@ -1,3290 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudError(msrest.serialization.Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): - """Components1Q1Og48SchemasManagedclusterAllof1. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom - private dns zone. - :type fqdn_subdomain: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_02_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - - -class Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): - """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(**kwargs) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_02_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_02_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_02_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class KubeletConfig(msrest.serialization.Model): - """Kubelet configurations of agent nodes. - - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection - is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection - is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """OS configurations of Linux agent nodes. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_02_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on - each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """maintenance configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_02_01.models.SystemData - :param time_in_week: Weekday time slots allowed to upgrade. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom - private dns zone. - :type fqdn_subdomain: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_02_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKU - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - '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': 'ManagedClusterSKU'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.sku = kwargs.get('sku', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", - "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", - "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", - "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", - "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", - "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", - "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", - "stable", "patch", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_02_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_02_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_02_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """ManagedClusterPodIdentity. - - Variables are only 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 name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2021_02_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """ManagedClusterPodIdentityException. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """ManagedClusterPodIdentityProfile. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in - cluster using Kubenet network plugin. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_02_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_node_provision_time: - :type max_node_provision_time: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable - Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.LicenseType - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_02_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_02_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_02_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_02_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.containerservice.v2021_02_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_02_01.models.WeekDay - :param hour_slots: hour slots in a day. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """The time span with start and end properties. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py index 929336d1e81b..f66f08025b6d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,11 +64,11 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -104,96 +106,97 @@ class AgentPool(SubResource): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this Public + IP Prefix. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool """ _validation = { @@ -278,6 +281,134 @@ def __init__( enable_encryption_at_host: Optional[bool] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this + Public IP Prefix. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -324,8 +455,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -348,6 +479,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -358,12 +494,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -380,6 +516,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -391,8 +535,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -412,6 +556,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -430,17 +578,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -470,6 +618,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -483,10 +644,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -501,6 +662,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -509,9 +676,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -524,6 +691,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -531,8 +703,8 @@ def __init__( class CloudError(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody """ _attribute_map = { @@ -545,6 +717,10 @@ def __init__( error: Optional["CloudErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody + """ super(CloudError, self).__init__(**kwargs) self.error = error @@ -552,17 +728,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -581,6 +757,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_02_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -593,8 +782,8 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -602,65 +791,65 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str + :ivar fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom private dns zone. - :type fqdn_subdomain: str + :vartype fqdn_subdomain: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_02_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] """ @@ -727,6 +916,65 @@ def __init__( identity_profile: Optional[Dict[str, "ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties"]] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + private dns zone. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_02_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + """ super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -781,6 +1029,8 @@ def __init__( self, **kwargs ): + """ + """ super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -789,12 +1039,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -811,6 +1061,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -820,12 +1078,12 @@ def __init__( class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -842,6 +1100,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -850,8 +1116,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMDiagnostics """ @@ -869,6 +1135,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -878,10 +1149,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -901,6 +1172,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -913,12 +1191,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_02_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_02_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -956,21 +1234,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -999,13 +1277,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_02_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -1020,34 +1359,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_02_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_02_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfile """ @@ -1086,6 +1426,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_02_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -1104,9 +1476,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshPublicKey] """ @@ -1124,6 +1496,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -1133,9 +1511,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -1152,6 +1530,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -1163,8 +1546,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -1185,6 +1568,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1215,6 +1602,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1241,6 +1630,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1248,34 +1639,34 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """Kubelet configurations of agent nodes. - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection + :ivar cpu_manager_policy: CPU Manager policy to use. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: Sets CPU CFS quota period value. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: The percent of disk usage after which image garbage collection is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: The percent of disk usage before which image garbage collection is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: Topology Manager policy to use. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1312,6 +1703,37 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: CPU Manager policy to use. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU + limits. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: Sets CPU CFS quota period value. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: The percent of disk usage after which image garbage + collection is always run. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: The percent of disk usage before which image garbage + collection is never run. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: Topology Manager policy to use. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1329,15 +1751,15 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """OS configurations of Linux agent nodes. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_02_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_02_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on each node. - :type swap_file_size_mb: int + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1356,6 +1778,17 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_02_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created + on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1377,10 +1810,10 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_02_01.models.SystemData - :param time_in_week: Weekday time slots allowed to upgrade. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeSpan] + :ivar time_in_week: Weekday time slots allowed to upgrade. + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeSpan] """ _validation = { @@ -1406,6 +1839,12 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: Weekday time slots allowed to upgrade. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_02_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1417,8 +1856,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1438,6 +1877,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1456,10 +1900,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1484,6 +1928,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1499,8 +1949,8 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -1508,65 +1958,65 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str + :ivar fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom private dns zone. - :type fqdn_subdomain: str + :vartype fqdn_subdomain: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_02_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] :ivar id: Resource Id. :vartype id: str @@ -1574,12 +2024,12 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKU + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKU """ _validation = { @@ -1658,6 +2108,71 @@ def __init__( sku: Optional["ManagedClusterSKU"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + private dns zone. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_02_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKU + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, fqdn_subdomain=fqdn_subdomain, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, pod_identity_profile=pod_identity_profile, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_upgrade_profile=auto_upgrade_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, **kwargs) self.identity = identity self.provisioning_state = None @@ -1697,21 +2212,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1736,6 +2251,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1759,12 +2292,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1791,6 +2324,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1802,10 +2343,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAddonProfileIdentity @@ -1829,6 +2370,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1838,12 +2385,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1860,6 +2407,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1868,11 +2423,11 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -1910,95 +2465,96 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this Public + IP Prefix. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool """ _validation = { @@ -2077,6 +2633,133 @@ def __init__( enable_encryption_at_host: Optional[bool] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this + Public IP Prefix. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2119,11 +2802,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + :vartype count: int + :ivar vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", @@ -2161,98 +2844,99 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_02_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this Public + IP Prefix. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -2334,6 +3018,136 @@ def __init__( enable_encryption_at_host: Optional[bool] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this + Public IP Prefix. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_02_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_02_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_02_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, **kwargs) self.name = name @@ -2341,12 +3155,12 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: Private dns zone mode for private cluster. + :vartype private_dns_zone: str """ _attribute_map = { @@ -2363,6 +3177,14 @@ def __init__( private_dns_zone: Optional[str] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: Private dns zone mode for private cluster. + :paramtype private_dns_zone: str + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2372,9 +3194,9 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + :ivar upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", "stable", "patch", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_02_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_02_01.models.UpgradeChannel """ _attribute_map = { @@ -2387,6 +3209,12 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + "stable", "patch", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_02_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2402,17 +3230,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_02_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2021_02_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_02_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ @@ -2435,6 +3263,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_02_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_02_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2447,8 +3289,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2468,6 +3310,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2476,27 +3322,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2524,6 +3369,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2536,9 +3404,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2555,6 +3423,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2562,8 +3435,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] """ @@ -2577,6 +3450,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2584,8 +3462,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] """ _attribute_map = { @@ -2598,6 +3476,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2609,12 +3491,12 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2021_02_01.models.UserAssignedIdentity + :ivar name: Required. Name of the pod identity. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity. + :vartype namespace: str + :ivar identity: Required. Information of the user assigned identity. + :vartype identity: ~azure.mgmt.containerservice.v2021_02_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2648,6 +3530,14 @@ def __init__( identity: "UserAssignedIdentity", **kwargs ): + """ + :keyword name: Required. Name of the pod identity. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity. + :paramtype namespace: str + :keyword identity: Required. Information of the user assigned identity. + :paramtype identity: ~azure.mgmt.containerservice.v2021_02_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2661,12 +3551,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. Name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. Pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2689,6 +3579,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. Name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. Pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2698,16 +3596,16 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """ManagedClusterPodIdentityProfile. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in cluster using Kubenet network plugin. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: User assigned pod identity settings. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: User assigned pod identity exception settings. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityException] """ @@ -2727,6 +3625,19 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in + cluster using Kubenet network plugin. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: User assigned pod identity settings. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: User assigned pod identity exception settings. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2737,8 +3648,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudError + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudError """ _attribute_map = { @@ -2751,6 +3662,10 @@ def __init__( error: Optional["CloudError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: ~azure.mgmt.containerservice.v2021_02_01.models.CloudError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2760,15 +3675,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2793,6 +3708,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2803,10 +3730,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2821,6 +3748,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2829,40 +3762,40 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_02_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_node_provision_time: - :type max_node_provision_time: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar expander: Possible values include: "least-waste", "most-pods", "priority", "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2021_02_01.models.Expander + :ivar max_empty_bulk_delete: + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: + :vartype ok_total_unready_count: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -2907,6 +3840,42 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword expander: Possible values include: "least-waste", "most-pods", "priority", "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_02_01.models.Expander + :keyword max_empty_bulk_delete: + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: + :paramtype ok_total_unready_count: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -2932,10 +3901,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -2954,6 +3923,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -2962,10 +3937,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -2980,6 +3955,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -2998,12 +3979,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3030,6 +4011,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3043,25 +4033,25 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + :vartype admin_password: str + :ivar license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.LicenseType + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.LicenseType """ _validation = { @@ -3082,6 +4072,27 @@ def __init__( license_type: Optional[Union[str, "LicenseType"]] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.LicenseType + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3109,6 +4120,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3154,6 +4167,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3166,9 +4181,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_02_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_02_01.models.Code """ _attribute_map = { @@ -3181,6 +4196,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_02_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3188,8 +4208,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -3202,6 +4222,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3221,11 +4245,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkServiceConnectionState """ @@ -3252,6 +4276,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3264,8 +4296,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3278,6 +4310,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3287,16 +4324,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3325,6 +4362,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3337,8 +4386,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3351,6 +4400,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3358,11 +4411,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_02_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_02_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3377,6 +4430,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_02_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3385,8 +4445,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3399,6 +4459,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3406,62 +4470,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -3528,6 +4592,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -3562,21 +4684,21 @@ def __init__( 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.containerservice.v2021_02_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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_02_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -3599,6 +4721,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_02_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -3611,8 +4751,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3625,6 +4765,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -3632,11 +4776,11 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_02_01.models.WeekDay - :param hour_slots: hour slots in a day. - :type hour_slots: list[int] + :vartype day: str or ~azure.mgmt.containerservice.v2021_02_01.models.WeekDay + :ivar hour_slots: hour slots in a day. + :vartype hour_slots: list[int] """ _attribute_map = { @@ -3651,6 +4795,13 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_02_01.models.WeekDay + :keyword hour_slots: hour slots in a day. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -3659,10 +4810,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """The time span with start and end properties. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -3677,6 +4828,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py index 34e49348e971..b9cab3396c6b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +332,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +341,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +385,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +419,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +444,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +495,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +522,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +547,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +573,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +612,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +633,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +658,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +677,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +709,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +734,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrade node image version of an agent pool to the latest. Upgrade node image version of an agent pool to the latest. @@ -647,15 +854,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -670,25 +880,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,4 +902,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py index ae7e05c8c148..7050a4776bf5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. The operation @@ -62,8 +220,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -71,36 +231,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,19 +275,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the maintenance configuration. Gets the details of maintenance configurations by managed cluster and resource group. @@ -151,28 +309,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -186,17 +334,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configurations. Creates or updates a maintenance configuration in the specified managed cluster. @@ -220,33 +370,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -260,16 +400,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes the maintenance configuration in the specified managed cluster. @@ -290,28 +432,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -323,3 +455,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py index e6bd81eeb636..9e38cfdc9d94 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py @@ -5,25 +5,620 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,19 +642,21 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -67,34 +664,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,17 +704,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -131,8 +724,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -140,35 +735,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,18 +777,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -217,27 +809,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,16 +833,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -286,28 +870,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,15 +895,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -348,27 +924,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -382,15 +948,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -409,27 +977,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -443,15 +1001,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -471,27 +1031,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +1055,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -532,27 +1084,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -566,47 +1108,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -624,16 +1157,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -647,15 +1182,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -667,27 +1207,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,47 +1233,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -753,16 +1277,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -775,15 +1301,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -795,27 +1326,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,41 +1352,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -874,13 +1389,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -891,15 +1407,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,21 +1431,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,47 +1450,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -992,14 +1493,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1010,18 +1512,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1033,24 +1539,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1062,47 +1562,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1115,14 +1605,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1136,15 +1627,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1156,24 +1650,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1185,41 +1673,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1232,13 +1710,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1249,15 +1728,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1271,21 +1752,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1297,41 +1771,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1344,13 +1808,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stop Managed Cluster. Stops a Running Managed Cluster. @@ -1361,15 +1826,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1383,21 +1850,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1409,41 +1869,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1456,13 +1906,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Start Managed Cluster. Starts a Stopped Managed Cluster. @@ -1473,15 +1924,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1495,21 +1948,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1521,4 +1967,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py index 2c1e2694bef6..061202a641c9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py index 3773209d1a70..fde7cdfdf087 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py index 435f90ad1c78..fd7c010f8bd0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. Gets a list of private link resources in the specified managed cluster. The operation returns @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - accept = "application/json" - - # Construct URL - url = self.list.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py index c87c610fb2f3..e16246d97916 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-02-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID the specified managed cluster. @@ -73,32 +120,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -112,4 +149,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py index 6dae34e095e9..84ac9425f266 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_container_service_client.py index 0a6d4504ffdc..012187223667 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_container_service_client.py @@ -6,104 +6,102 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_03_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_03_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_03_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_03_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_03_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_03_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_03_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_03_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_03_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_03_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_03_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_03_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_metadata.json index da52cae2a1c0..5794456e4881 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py index e9ac221f1d4f..7431c711bf42 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_container_service_client.py index 2e9ff14d4f28..a7ec2ca904ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_container_service_client.py @@ -6,100 +6,103 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_03_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_03_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_03_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_03_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_03_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_03_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_03_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_03_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_03_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_03_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_03_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_03_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_03_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py index dc1ad4ec91a2..e5e4054cab17 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -60,7 +66,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -68,36 +75,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +119,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -147,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -182,8 +178,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -197,33 +195,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -241,8 +229,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -265,15 +256,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -286,28 +282,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -319,6 +308,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -333,28 +323,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -367,6 +347,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -386,15 +368,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -409,22 +393,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -436,8 +412,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -466,28 +444,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -501,8 +469,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -633,15 +589,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -656,25 +616,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,4 +638,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py index a3ca5505ab61..01ee4e9bc1c5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -57,8 +63,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -66,36 +74,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -145,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -180,8 +177,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -213,33 +213,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -253,8 +243,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -282,28 +275,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -315,3 +298,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py index f08bf28f36a9..d81ee691ffe7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get_os_options( self, location: str, @@ -67,28 +73,17 @@ async def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -102,8 +97,11 @@ async def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -114,8 +112,10 @@ def list( of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -123,34 +123,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -168,11 +163,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -186,8 +183,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -195,35 +194,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -241,11 +236,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -271,27 +268,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -305,8 +292,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -339,28 +329,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -374,8 +354,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -400,27 +383,17 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -434,8 +407,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -460,27 +436,17 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -494,8 +460,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -521,27 +490,17 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -555,8 +514,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -581,27 +543,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -615,8 +567,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -629,32 +583,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -672,8 +616,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -694,15 +641,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -714,27 +666,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -746,6 +692,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -760,32 +707,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -799,8 +736,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -820,15 +760,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -840,27 +785,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -872,6 +811,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -885,27 +825,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -918,6 +848,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -934,15 +866,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -956,21 +890,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -982,6 +909,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -996,32 +924,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1034,6 +952,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -1051,18 +971,22 @@ async def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1074,24 +998,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1103,6 +1021,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1117,32 +1036,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1155,6 +1064,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1175,15 +1086,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1195,24 +1109,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1224,6 +1132,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1237,27 +1146,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1270,6 +1169,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1286,15 +1187,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1308,21 +1211,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1334,6 +1230,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1347,27 +1244,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1380,6 +1267,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1396,15 +1285,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1418,21 +1309,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1444,6 +1328,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1457,27 +1342,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1490,6 +1365,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1506,15 +1383,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1528,21 +1407,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1554,6 +1426,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore async def _run_command_initial( @@ -1568,32 +1441,22 @@ async def _run_command_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1609,8 +1472,11 @@ async def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async async def begin_run_command( self, resource_group_name: str, @@ -1631,15 +1497,20 @@ async def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_03_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1651,27 +1522,21 @@ async def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1683,8 +1548,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace_async async def get_command_result( self, resource_group_name: str, @@ -1712,28 +1579,18 @@ async def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1749,4 +1606,6 @@ async def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py index dc25a3e45be6..225e7b349389 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,7 +55,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py index 96c6c0ee9532..8b5078f6f771 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -130,28 +128,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -165,8 +153,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -197,33 +188,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -237,8 +218,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -251,28 +234,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -285,6 +258,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -304,15 +279,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -327,22 +304,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -354,4 +323,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py index 7569378b2b7d..2a31c0acb30e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py index 0cdd4fdc4eb9..4c29cfab30ec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -68,32 +73,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -107,4 +102,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/__init__.py index 5c95b0b2520f..a7cefae87175 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/__init__.py @@ -6,158 +6,82 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudError - from ._models_py3 import CloudErrorBody - from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 - from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import ExtendedLocation - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterHTTPProxyConfig - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OSOptionProfile - from ._models_py3 import OSOptionProperty - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import RunCommandRequest - from ._models_py3 import RunCommandResult - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudError # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import Components1Q1Og48SchemasManagedclusterAllof1 # type: ignore - from ._models import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import ExtendedLocation # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterHTTPProxyConfig # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OSOptionProfile # type: ignore - from ._models import OSOptionProperty # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import RunCommandRequest # type: ignore - from ._models import RunCommandResult # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudError +from ._models_py3 import CloudErrorBody +from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 +from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties +from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_container_service_client_enums.py index bdf1668dad13..30ac21518ac2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_container_service_client_enums.py @@ -6,48 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolMode represents mode of an agent pool. """ SYSTEM = "System" USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """AgentPoolType represents types of an agent pool. """ VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ RUNNING = "Running" STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -56,7 +41,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. """ @@ -64,7 +49,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. """ @@ -243,7 +228,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -252,7 +237,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -261,20 +246,20 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LEAST_WASTE = "least-waste" MOST_PODS = "most-pods" PRIORITY = "priority" RANDOM = "random" -class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of extendedLocation. """ EDGE_ZONE = "EdgeZone" -class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. """ @@ -285,7 +270,7 @@ class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIG4_G = "MIG4g" MIG7_G = "MIG7g" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Allowed values: 'OS', 'Temporary' (preview). """ @@ -293,7 +278,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OS = "OS" TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. """ @@ -301,14 +286,14 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The load balancer sku for the managed cluster. """ STANDARD = "standard" BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -317,48 +302,48 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tier of a managed cluster SKU. """ PAID = "Paid" FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network mode used for building Kubernetes network. """ TRANSPARENT = "transparent" BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building Kubernetes network. """ AZURE = "azure" KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building Kubernetes network. """ CALICO = "calico" AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OSDiskType represents the type of an OS disk on an agent pool. """ MANAGED = "Managed" EPHEMERAL = "Ephemeral" -class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to Windows OSType. """ @@ -366,21 +351,21 @@ class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UBUNTU = "Ubuntu" CBL_MARINER = "CBLMariner" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. """ LINUX = "Linux" WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The outbound (egress) routing method. """ LOAD_BALANCER = "loadBalancer" USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -389,7 +374,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service @@ -400,7 +385,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. """ @@ -408,14 +393,14 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) DELETE = "Delete" DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. """ SPOT = "Spot" REGULAR = "Regular" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """upgrade channel for auto upgrade. """ @@ -425,7 +410,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NODE_IMAGE = "node-image" NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models.py deleted file mode 100644 index 4d765ffb80c1..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models.py +++ /dev/null @@ -1,3482 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner - for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", - "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values - include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param enable_fips: Whether to use FIPS enabled OS. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible - values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the agent pool available versions. - :vartype id: str - :ivar name: Name of the agent pool available versions. - :vartype name: str - :ivar type: Type of the agent pool available versions. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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: Id of the agent pool upgrade profile. - :vartype id: str - :ivar name: Name of the agent pool upgrade profile. - :vartype name: str - :ivar type: Type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image - version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty - uses AKS default. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudError(msrest.serialization.Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): - """Components1Q1Og48SchemasManagedclusterAllof1. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom - private dns zone. - :type fqdn_subdomain: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_03_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credential will be disabled for - this cluster. Expected to only be used for AAD clusters. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterHTTPProxyConfig - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - - -class Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """UserAssignedIdentity. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): - """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(**kwargs) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_03_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values - include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. Only expect one key specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_03_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class ExtendedLocation(msrest.serialization.Model): - """The complex type of the extended location. - - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocationTypes - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtendedLocation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class KubeletConfig(msrest.serialization.Model): - """Kubelet configurations of agent nodes. - - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection - is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection - is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """OS configurations of Linux agent nodes. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_03_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on - each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """maintenance configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_03_01.models.SystemData - :param time_in_week: Weekday time slots allowed to upgrade. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Represents the Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom - private dns zone. - :type fqdn_subdomain: str - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - :ivar private_fqdn: FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling - encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_03_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credential will be disabled for - this cluster. Expected to only be used for AAD clusters. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterHTTPProxyConfig - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocation - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - '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': 'ManagedClusterSKU'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner - for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", - "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param enable_fips: Whether to use FIPS enabled OS. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible - values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values - are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports - ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults - to 'Managed'. May not be changed after creation. Possible values include: "Managed", - "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, - container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, - resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe - pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to - Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner - for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", - "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed - cluster. - :type orchestrator_version: str - :ivar node_image_version: Version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets - AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set - priority. Default to regular. Possible values include: "Spot", "Regular". Default value: - "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy - for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to - pay in US Dollars. Possible values are any decimal value greater than zero or -1 which - indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine - scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, - key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param enable_fips: Whether to use FIPS enabled OS. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible - values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile - :param name: Required. Unique name of the agent pool profile in the context of the subscription - and resource group. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", - "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_03_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): - """Configurations for provisioning the cluster with HTTP proxy servers. - - :param http_proxy: HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: Endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str - """ - - _attribute_map = { - 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, - 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, - 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, - 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) - self.http_proxy = kwargs.get('http_proxy', None) - self.https_proxy = kwargs.get('https_proxy', None) - self.no_proxy = kwargs.get('no_proxy', None) - self.trusted_ca = kwargs.get('trusted_ca', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use - an implicitly created identity in master components and an auto-created user assigned identity - in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, - service principal will be used instead. Possible values include: "SystemAssigned", - "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane and only one user assigned identity is allowed. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_03_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values - must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure - dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: Desired number of outbound IP created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """ManagedClusterPodIdentity. - - Variables are only 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 name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param binding_selector: Binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2021_03_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.binding_selector = kwargs.get('binding_selector', None) - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """ManagedClusterPodIdentityException. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """ManagedClusterPodIdentityProfile. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in - cluster using Kubenet network plugin. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. - Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_03_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_node_provision_time: - :type max_node_provision_time: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """ManagedClusterSKU. - - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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: Id of upgrade profile. - :vartype id: str - :ivar name: Name of upgrade profile. - :vartype name: str - :ivar type: Type of upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable - Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.LicenseType - :param enable_csi_proxy: Whether to enable CSI proxy. - :type enable_csi_proxy: bool - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of compute operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_03_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSOptionProfile(msrest.serialization.Model): - """The OS option profile. - - Variables are only 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: Id of the OS option profile. - :vartype id: str - :ivar name: Name of the OS option profile. - :vartype name: str - :ivar type: Type of the OS option profile. - :vartype type: str - :param os_option_property_list: Required. The list of OS option properties. - :type os_option_property_list: - list[~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProperty] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.os_option_property_list = kwargs['os_option_property_list'] - - -class OSOptionProperty(msrest.serialization.Model): - """OS option property. - - All required parameters must be populated in order to send to Azure. - - :param os_type: Required. OS type. - :type os_type: str - :param enable_fips_image: Required. Whether FIPS image is enabled. - :type enable_fips_image: bool - """ - - _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, - } - - _attribute_map = { - 'os_type': {'key': 'os-type', 'type': 'str'}, - 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProperty, self).__init__(**kwargs) - self.os_type = kwargs['os_type'] - self.enable_fips_image = kwargs['enable_fips_image'] - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_03_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource Id for private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_03_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class RunCommandRequest(msrest.serialization.Model): - """run command request. - - All required parameters must be populated in order to send to Azure. - - :param command: Required. command to run. - :type command: str - :param context: base64 encoded zip file, contains files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str - """ - - _validation = { - 'command': {'required': True}, - } - - _attribute_map = { - 'command': {'key': 'command', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandRequest, self).__init__(**kwargs) - self.command = kwargs['command'] - self.context = kwargs.get('context', None) - self.cluster_token = kwargs.get('cluster_token', None) - - -class RunCommandResult(msrest.serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: exit code of the command. - :vartype exit_code: int - :ivar started_at: time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: command output. - :vartype logs: str - :ivar reason: explain why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'exit_code': {'readonly': True}, - 'started_at': {'readonly': True}, - 'finished_at': {'readonly': True}, - 'logs': {'readonly': True}, - 'reason': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, - 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, - 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, - 'logs': {'key': 'properties.logs', 'type': 'str'}, - 'reason': {'key': 'properties.reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandResult, self).__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_03_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.containerservice.v2021_03_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_03_01.models.WeekDay - :param hour_slots: hour slots in a day. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """The time span with start and end properties. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py index f517e3867257..dcf49843efe6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,110 +64,111 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :vartype count: int + :ivar vm_size: Size of agent VMs. + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :ivar os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: AgentPoolType represents types of an agent pool. Possible values + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this Public + IP Prefix. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param enable_fips: Whether to use FIPS enabled OS. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool + :ivar enable_fips: Whether to use FIPS enabled OS. + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile """ @@ -257,6 +260,107 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :keyword os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner + for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", + "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: AgentPoolType represents types of an agent pool. Possible values + include: "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this + Public IP Prefix. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + :keyword enable_fips: Whether to use FIPS enabled OS. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. + Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -306,8 +410,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool available versions. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -330,6 +434,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -340,12 +449,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -362,6 +471,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -373,8 +490,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -394,6 +511,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -412,17 +533,17 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image + :ivar latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node image version. - :type latest_node_image_version: str + :vartype latest_node_image_version: str """ _validation = { @@ -452,6 +573,19 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: LatestNodeImageVersion is the latest AKS supported node + image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -465,10 +599,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -483,6 +617,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -491,9 +631,9 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: Count or percentage of additional nodes to be added during upgrade. If empty + :ivar max_surge: Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -506,6 +646,11 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: Count or percentage of additional nodes to be added during upgrade. If + empty uses AKS default. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -513,8 +658,8 @@ def __init__( class CloudError(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody """ _attribute_map = { @@ -527,6 +672,10 @@ def __init__( error: Optional["CloudErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody + """ super(CloudError, self).__init__(**kwargs) self.error = error @@ -534,17 +683,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -563,6 +712,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_03_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -575,8 +737,8 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -584,74 +746,74 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str + :ivar fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom private dns zone. - :type fqdn_subdomain: str + :vartype fqdn_subdomain: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_03_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credential will be disabled for + :ivar disable_local_accounts: If set to true, getting static credential will be disabled for this cluster. Expected to only be used for AAD clusters. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterHTTPProxyConfig """ @@ -724,6 +886,75 @@ def __init__( http_proxy_config: Optional["ManagedClusterHTTPProxyConfig"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + private dns zone. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_03_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credential will be disabled for + this cluster. Expected to only be used for AAD clusters. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterHTTPProxyConfig + """ super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -781,6 +1012,8 @@ def __init__( self, **kwargs ): + """ + """ super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -789,12 +1022,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -811,6 +1044,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -820,12 +1061,12 @@ def __init__( class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -842,6 +1083,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -850,8 +1099,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceVMDiagnostics """ @@ -869,6 +1118,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -878,10 +1132,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -901,6 +1155,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -913,12 +1174,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_03_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_03_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -956,21 +1217,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -999,13 +1260,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_03_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -1020,34 +1342,35 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPlugin - :param network_policy: Network policy used for building Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPolicy - :param network_mode: Network mode used for building Kubernetes network. Possible values - include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPolicy + :ivar network_mode: Network mode used for building Kubernetes network. Possible values include: + "transparent", "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: The outbound (egress) routing method. Possible values include: + :vartype docker_bridge_cidr: str + :ivar outbound_type: The outbound (egress) routing method. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OutboundType - :param load_balancer_sku: The load balancer sku for the managed cluster. Possible values + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_03_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfile """ @@ -1086,6 +1409,38 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building Kubernetes network. Possible values + include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkPolicy + :keyword network_mode: Network mode used for building Kubernetes network. Possible values + include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: The outbound (egress) routing method. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OutboundType + :keyword load_balancer_sku: The load balancer sku for the managed cluster. Possible values + include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_03_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -1104,9 +1459,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshPublicKey] """ @@ -1124,6 +1479,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. Only expect one key specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -1133,9 +1494,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -1152,6 +1513,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -1163,8 +1529,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -1185,6 +1551,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1215,6 +1585,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1241,6 +1613,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1248,10 +1622,10 @@ def __init__( class ExtendedLocation(msrest.serialization.Model): """The complex type of the extended location. - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocationTypes + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1266,6 +1640,12 @@ def __init__( type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocationTypes + """ super(ExtendedLocation, self).__init__(**kwargs) self.name = name self.type = type @@ -1274,34 +1654,34 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """Kubelet configurations of agent nodes. - :param cpu_manager_policy: CPU Manager policy to use. - :type cpu_manager_policy: str - :param cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: Sets CPU CFS quota period value. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: The percent of disk usage after which image garbage collection + :ivar cpu_manager_policy: CPU Manager policy to use. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU limits. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: Sets CPU CFS quota period value. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: The percent of disk usage after which image garbage collection is always run. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: The percent of disk usage before which image garbage collection + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: The percent of disk usage before which image garbage collection is never run. - :type image_gc_low_threshold: int - :param topology_manager_policy: Topology Manager policy to use. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: Topology Manager policy to use. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1338,6 +1718,37 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: CPU Manager policy to use. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: Enable CPU CFS quota enforcement for containers that specify CPU + limits. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: Sets CPU CFS quota period value. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: The percent of disk usage after which image garbage + collection is always run. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: The percent of disk usage before which image garbage + collection is never run. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: Topology Manager policy to use. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1355,15 +1766,15 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """OS configurations of Linux agent nodes. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_03_01.models.SysctlConfig - :param transparent_huge_page_enabled: Transparent Huge Page enabled configuration. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Transparent Huge Page defrag configuration. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_03_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created on each node. - :type swap_file_size_mb: int + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1382,6 +1793,17 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_03_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Transparent Huge Page enabled configuration. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Transparent Huge Page defrag configuration. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: SwapFileSizeMB specifies size in MB of a swap file will be created + on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1403,10 +1825,10 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_03_01.models.SystemData - :param time_in_week: Weekday time slots allowed to upgrade. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeSpan] + :ivar time_in_week: Weekday time slots allowed to upgrade. + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeSpan] """ _validation = { @@ -1432,6 +1854,12 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: Weekday time slots allowed to upgrade. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_03_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1443,8 +1871,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1464,6 +1892,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1482,10 +1915,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1510,6 +1943,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1525,8 +1964,8 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -1534,74 +1973,74 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: Version of Kubernetes specified when creating the managed cluster. - :type kubernetes_version: str - :param dns_prefix: DNS prefix specified when creating the managed cluster. - :type dns_prefix: str - :param fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + :ivar kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :vartype kubernetes_version: str + :ivar dns_prefix: DNS prefix specified when creating the managed cluster. + :vartype dns_prefix: str + :ivar fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom private dns zone. - :type fqdn_subdomain: str + :vartype fqdn_subdomain: str :ivar fqdn: FQDN for the master pool. :vartype fqdn: str :ivar private_fqdn: FQDN of private cluster. :vartype private_fqdn: str :ivar azure_portal_fqdn: FQDN for the master pool which used by proxy config. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: Properties of the agent pool. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Properties of the agent pool. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: Profile for Linux VMs in the container service cluster. - :type linux_profile: + :ivar linux_profile: Profile for Linux VMs in the container service cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceLinuxProfile - :param windows_profile: Profile for Windows VMs in the container service cluster. - :type windows_profile: + :ivar windows_profile: Profile for Windows VMs in the container service cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: Profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: Profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: Profile of managed cluster pod identity. - :type pod_identity_profile: + :ivar pod_identity_profile: Profile of managed cluster pod identity. + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: Name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: Name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: Profile of network configuration. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: Profile of network configuration. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceNetworkProfile - :param aad_profile: Profile of Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: Profile of auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: Profile of Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: Profile of auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: Access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: Access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + :ivar disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling encryption at rest. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_03_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credential will be disabled for + :ivar disable_local_accounts: If set to true, getting static credential will be disabled for this cluster. Expected to only be used for AAD clusters. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterHTTPProxyConfig :ivar id: Resource Id. :vartype id: str @@ -1609,14 +2048,14 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocation + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocation """ _validation = { @@ -1703,6 +2142,83 @@ def __init__( extended_location: Optional["ExtendedLocation"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterIdentity + :keyword kubernetes_version: Version of Kubernetes specified when creating the managed cluster. + :paramtype kubernetes_version: str + :keyword dns_prefix: DNS prefix specified when creating the managed cluster. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: FQDN subdomain specified when creating private cluster with custom + private dns zone. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: Properties of the agent pool. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: Profile for Linux VMs in the container service cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: Profile for Windows VMs in the container service cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: Profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: Profile of managed cluster pod identity. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: Name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: Profile of network configuration. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: Profile of Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: Profile of auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: Access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_03_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credential will be disabled for + this cluster. Expected to only be used for AAD clusters. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterHTTPProxyConfig + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: ~azure.mgmt.containerservice.v2021_03_01.models.ExtendedLocation + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, fqdn_subdomain=fqdn_subdomain, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, pod_identity_profile=pod_identity_profile, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_upgrade_profile=auto_upgrade_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, private_link_resources=private_link_resources, disable_local_accounts=disable_local_accounts, http_proxy_config=http_proxy_config, **kwargs) self.identity = identity self.provisioning_state = None @@ -1747,21 +2263,21 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """AADProfile specifies attributes for Azure Active Directory integration. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: AAD group object IDs that will have admin role of the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1786,6 +2302,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: AAD group object IDs that will have admin role of the + cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1809,12 +2343,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1841,6 +2375,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1852,10 +2394,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAddonProfileIdentity @@ -1879,6 +2421,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1888,12 +2436,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource id of the user assigned identity. - :type resource_id: str - :param client_id: The client id of the user assigned identity. - :type client_id: str - :param object_id: The object id of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource id of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client id of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object id of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1910,6 +2458,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client id of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object id of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1918,109 +2474,110 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :vartype count: int + :ivar vm_size: Size of agent VMs. + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :ivar os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this Public + IP Prefix. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param enable_fips: Whether to use FIPS enabled OS. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool + :ivar enable_fips: Whether to use FIPS enabled OS. + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile """ @@ -2106,6 +2663,106 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :keyword os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner + for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", + "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this + Public IP Prefix. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + :keyword enable_fips: Whether to use FIPS enabled OS. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. + Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2151,113 +2808,114 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: Size of agent VMs. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values + :vartype count: int + :ivar vm_size: Size of agent VMs. + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType - :param kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType + :ivar kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and maybe pods. - :type vnet_subnet_id: str - :param pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. - :type pod_subnet_id: str - :param max_pods: Maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :vartype pod_subnet_id: str + :ivar max_pods: Maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :ivar os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU - :param max_count: Maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: Minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: AgentPoolType represents types of an agent pool. Possible values include: + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU + :ivar max_count: Maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: Minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: AgentPoolType represents types of an agent pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType - :param mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", + :vartype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType + :ivar mode: AgentPoolMode represents mode of an agent pool. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode - :param orchestrator_version: Version of orchestrator specified when creating the managed + :vartype mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode + :ivar orchestrator_version: Version of orchestrator specified when creating the managed cluster. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: Version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state, which only appears in the response. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_03_01.models.PowerState - :param availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + :ivar availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. - :type availability_zones: list[str] - :param enable_node_public_ip: Enable public IP for nodes. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this - Public IP Prefix. - :type node_public_ip_prefix_id: str - :param scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Enable public IP for nodes. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this Public + IP Prefix. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority - :param scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy + :ivar scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy - :param spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to + :ivar spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. - :type spot_max_price: float - :param tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + :vartype spot_max_price: float + :ivar tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: Agent pool node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: Taints added to new nodes during node pool create and scale. For example, + :vartype tags: dict[str, str] + :ivar node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig - :param linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig - :param enable_encryption_at_host: Whether to enable EncryptionAtHost. - :type enable_encryption_at_host: bool - :param enable_fips: Whether to use FIPS enabled OS. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig + :ivar linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable EncryptionAtHost. + :vartype enable_encryption_at_host: bool + :ivar enable_fips: Whether to use FIPS enabled OS. + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile - :param name: Required. Unique name of the agent pool profile in the context of the subscription + :ivar name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. - :type name: str + :vartype name: str """ _validation = { @@ -2345,6 +3003,109 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: Size of agent VMs. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: OS disk type to be used for machines in a given agent pool. Allowed + values are 'Ephemeral' and 'Managed'. If unspecified, defaults to 'Ephemeral' when the VM + supports ephemeral OS and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + defaults to 'Managed'. May not be changed after creation. Possible values include: "Managed", + "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSDiskType + :keyword kubelet_disk_type: KubeletDiskType determines the placement of emptyDir volumes, + container runtime data root, and Kubelet ephemeral storage. Currently allows one value, OS, + resulting in Kubelet using the OS disk for data. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.KubeletDiskType + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier for nodes and + maybe pods. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: Pod SubnetID specifies the VNet's subnet identifier for pods. + :paramtype pod_subnet_id: str + :keyword max_pods: Maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: OsType to be used to specify os type. Choose from Linux and Windows. Default + to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :keyword os_sku: OsSKU to be used to specify os sku. Choose from Ubuntu(default) and CBLMariner + for Linux OSType. Not applicable to Windows OSType. Possible values include: "Ubuntu", + "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSSKU + :keyword max_count: Maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: Minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: AgentPoolType represents types of an agent pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolType + :keyword mode: AgentPoolMode represents mode of an agent pool. Possible values include: + "System", "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolMode + :keyword orchestrator_version: Version of orchestrator specified when creating the managed + cluster. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: Availability zones for nodes. Must use VirtualMachineScaleSets + AgentPoolType. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Enable public IP for nodes. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: Public IP Prefix ID. VM nodes use IPs assigned from this + Public IP Prefix. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: ScaleSetPriority to be used to specify virtual machine scale set + priority. Default to regular. Possible values include: "Spot", "Regular". Default value: + "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: ScaleSetEvictionPolicy to be used to specify eviction + policy for Spot virtual machine scale set. Default to Delete. Possible values include: + "Delete", "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_03_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: SpotMaxPrice to be used to specify the maximum price you are willing + to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which + indicates default price to be up-to on-demand. + :paramtype spot_max_price: float + :keyword tags: A set of tags. Agent pool tags to be persisted on the agent pool virtual machine + scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: Agent pool node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: KubeletConfig specifies the configuration of kubelet on agent nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_03_01.models.KubeletConfig + :keyword linux_os_config: LinuxOSConfig specifies the OS configuration of linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_03_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: Whether to enable EncryptionAtHost. + :paramtype enable_encryption_at_host: bool + :keyword enable_fips: Whether to use FIPS enabled OS. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Supported values are MIG1g, MIG2g, MIG3g, MIG4g and MIG7g. + Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_03_01.models.GPUInstanceProfile + :keyword name: Required. Unique name of the agent pool profile in the context of the + subscription and resource group. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, **kwargs) self.name = name @@ -2352,12 +3113,12 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: Whether to create the cluster as a private cluster or not. - :type enable_private_cluster: bool - :param private_dns_zone: Private dns zone mode for private cluster. - :type private_dns_zone: str + :ivar authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: Whether to create the cluster as a private cluster or not. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: Private dns zone mode for private cluster. + :vartype private_dns_zone: str """ _attribute_map = { @@ -2374,6 +3135,14 @@ def __init__( private_dns_zone: Optional[str] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: Authorized IP Ranges to kubernetes API server. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: Whether to create the cluster as a private cluster or not. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: Private dns zone mode for private cluster. + :paramtype private_dns_zone: str + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2383,9 +3152,9 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + :ivar upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_03_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_03_01.models.UpgradeChannel """ _attribute_map = { @@ -2398,6 +3167,12 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: upgrade channel for auto upgrade. Possible values include: "rapid", + "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_03_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2405,14 +3180,14 @@ def __init__( class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): """Configurations for provisioning the cluster with HTTP proxy servers. - :param http_proxy: HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: Endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str + :ivar http_proxy: HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: Endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str """ _attribute_map = { @@ -2431,6 +3206,16 @@ def __init__( trusted_ca: Optional[str] = None, **kwargs ): + """ + :keyword http_proxy: HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: Endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) self.http_proxy = http_proxy self.https_proxy = https_proxy @@ -2449,17 +3234,17 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use + :ivar type: The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ResourceIdentityType - :param user_assigned_identities: The user identity associated with the managed cluster. This + :vartype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ResourceIdentityType + :ivar user_assigned_identities: The user identity associated with the managed cluster. This identity will be used in control plane and only one user assigned identity is allowed. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_03_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ @@ -2482,6 +3267,20 @@ def __init__( user_assigned_identities: Optional[Dict[str, "Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ): + """ + :keyword type: The type of identity used for the managed cluster. Type 'SystemAssigned' will + use an implicitly created identity in master components and an auto-created user assigned + identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: "SystemAssigned", + "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_03_01.models.ResourceIdentityType + :keyword user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane and only one user assigned identity is allowed. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_03_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2494,8 +3293,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2515,6 +3314,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2523,27 +3326,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] - :param allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values + :ivar allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2571,6 +3373,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] + :keyword allocated_outbound_ports: Desired number of allocated SNAT ports per VM. Allowed + values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2583,9 +3408,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: Desired number of outbound IP created/managed by Azure for the cluster load + :ivar count: Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2602,6 +3427,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: Desired number of outbound IP created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2609,8 +3439,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] """ @@ -2624,6 +3454,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2631,8 +3466,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] """ _attribute_map = { @@ -2645,6 +3480,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_03_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2656,14 +3495,14 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity. - :type name: str - :param namespace: Required. Namespace of the pod identity. - :type namespace: str - :param binding_selector: Binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. Information of the user assigned identity. - :type identity: ~azure.mgmt.containerservice.v2021_03_01.models.UserAssignedIdentity + :ivar name: Required. Name of the pod identity. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: Binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. Information of the user assigned identity. + :vartype identity: ~azure.mgmt.containerservice.v2021_03_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2699,6 +3538,16 @@ def __init__( binding_selector: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. Name of the pod identity. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: Binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. Information of the user assigned identity. + :paramtype identity: ~azure.mgmt.containerservice.v2021_03_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2713,12 +3562,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the pod identity exception. - :type name: str - :param namespace: Required. Namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. Pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. Name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. Namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. Pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2741,6 +3590,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. Name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. Namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. Pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2750,16 +3607,16 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """ManagedClusterPodIdentityProfile. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in cluster using Kubenet network plugin. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: User assigned pod identity settings. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: User assigned pod identity settings. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: User assigned pod identity exception settings. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: User assigned pod identity exception settings. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityException] """ @@ -2779,6 +3636,19 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Customer consent for enabling AAD pod identity addon in + cluster using Kubenet network plugin. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: User assigned pod identity settings. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: User assigned pod identity exception settings. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2789,8 +3659,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudError + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudError """ _attribute_map = { @@ -2803,6 +3673,10 @@ def __init__( error: Optional["CloudError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: ~azure.mgmt.containerservice.v2021_03_01.models.CloudError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2812,15 +3686,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param name: Pool name. - :type name: str - :param os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. + :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar name: Pool name. + :vartype name: str + :ivar os_type: Required. OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2845,6 +3719,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword name: Pool name. + :paramtype name: str + :keyword os_type: Required. OsType to be used to specify os type. Choose from Linux and + Windows. Default to Linux. Possible values include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2855,10 +3741,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: Kubernetes version (major, minor, patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: Kubernetes version (major, minor, patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2873,6 +3759,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: Kubernetes version (major, minor, patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2881,40 +3773,40 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: - :type balance_similar_node_groups: str - :param expander: Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_03_01.models.Expander - :param max_empty_bulk_delete: - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: - :type max_graceful_termination_sec: str - :param max_node_provision_time: - :type max_node_provision_time: str - :param max_total_unready_percentage: - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: - :type ok_total_unready_count: str - :param scan_interval: - :type scan_interval: str - :param scale_down_delay_after_add: - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: - :type scale_down_unneeded_time: str - :param scale_down_unready_time: - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: - :type skip_nodes_with_system_pods: str + :ivar balance_similar_node_groups: + :vartype balance_similar_node_groups: str + :ivar expander: Possible values include: "least-waste", "most-pods", "priority", "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2021_03_01.models.Expander + :ivar max_empty_bulk_delete: + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: + :vartype ok_total_unready_count: str + :ivar scan_interval: + :vartype scan_interval: str + :ivar scale_down_delay_after_add: + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -2959,6 +3851,42 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: + :paramtype balance_similar_node_groups: str + :keyword expander: Possible values include: "least-waste", "most-pods", "priority", "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_03_01.models.Expander + :keyword max_empty_bulk_delete: + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: + :paramtype ok_total_unready_count: str + :keyword scan_interval: + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -2984,10 +3912,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -3006,6 +3934,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -3014,10 +3948,10 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """ManagedClusterSKU. - :param name: Name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUName - :param tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUTier + :ivar name: Name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUName + :ivar tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :vartype tier: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -3032,6 +3966,12 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: Name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUName + :keyword tier: Tier of a managed cluster SKU. Possible values include: "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -3050,12 +3990,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3082,6 +4022,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3095,27 +4044,27 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + :vartype admin_password: str + :ivar license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.LicenseType - :param enable_csi_proxy: Whether to enable CSI proxy. - :type enable_csi_proxy: bool + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.LicenseType + :ivar enable_csi_proxy: Whether to enable CSI proxy. + :vartype enable_csi_proxy: bool """ _validation = { @@ -3138,6 +4087,29 @@ def __init__( enable_csi_proxy: Optional[bool] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The licenseType to use for Windows VMs. Windows_Server is used to enable + Azure Hybrid User Benefits for Windows VMs. Possible values include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.LicenseType + :keyword enable_csi_proxy: Whether to enable CSI proxy. + :paramtype enable_csi_proxy: bool + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3166,6 +4138,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3211,6 +4185,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3233,8 +4209,8 @@ class OSOptionProfile(msrest.serialization.Model): :vartype name: str :ivar type: Type of the OS option profile. :vartype type: str - :param os_option_property_list: Required. The list of OS option properties. - :type os_option_property_list: + :ivar os_option_property_list: Required. The list of OS option properties. + :vartype os_option_property_list: list[~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProperty] """ @@ -3258,6 +4234,11 @@ def __init__( os_option_property_list: List["OSOptionProperty"], **kwargs ): + """ + :keyword os_option_property_list: Required. The list of OS option properties. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProperty] + """ super(OSOptionProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3270,10 +4251,10 @@ class OSOptionProperty(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param os_type: Required. OS type. - :type os_type: str - :param enable_fips_image: Required. Whether FIPS image is enabled. - :type enable_fips_image: bool + :ivar os_type: Required. OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether FIPS image is enabled. + :vartype enable_fips_image: bool """ _validation = { @@ -3293,6 +4274,12 @@ def __init__( enable_fips_image: bool, **kwargs ): + """ + :keyword os_type: Required. OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether FIPS image is enabled. + :paramtype enable_fips_image: bool + """ super(OSOptionProperty, self).__init__(**kwargs) self.os_type = os_type self.enable_fips_image = enable_fips_image @@ -3301,9 +4288,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_03_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_03_01.models.Code """ _attribute_map = { @@ -3316,6 +4303,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_03_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3323,8 +4315,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource Id for private endpoint. - :type id: str + :ivar id: The resource Id for private endpoint. + :vartype id: str """ _attribute_map = { @@ -3337,6 +4329,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource Id for private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3356,11 +4352,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkServiceConnectionState """ @@ -3387,6 +4383,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3399,8 +4403,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3413,6 +4417,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3422,16 +4431,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3460,6 +4469,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3472,8 +4493,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3486,6 +4507,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3493,11 +4518,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_03_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_03_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3512,6 +4537,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_03_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3520,8 +4552,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3534,6 +4566,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3543,12 +4579,12 @@ class RunCommandRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command: Required. command to run. - :type command: str - :param context: base64 encoded zip file, contains files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str + :ivar command: Required. command to run. + :vartype command: str + :ivar context: base64 encoded zip file, contains files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str """ _validation = { @@ -3569,6 +4605,14 @@ def __init__( cluster_token: Optional[str] = None, **kwargs ): + """ + :keyword command: Required. command to run. + :paramtype command: str + :keyword context: base64 encoded zip file, contains files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ super(RunCommandRequest, self).__init__(**kwargs) self.command = command self.context = context @@ -3620,6 +4664,8 @@ def __init__( self, **kwargs ): + """ + """ super(RunCommandResult, self).__init__(**kwargs) self.id = None self.provisioning_state = None @@ -3633,62 +4679,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -3755,6 +4801,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -3789,21 +4893,21 @@ def __init__( 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.containerservice.v2021_03_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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_03_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -3826,6 +4930,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_03_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -3838,8 +4960,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3852,6 +4974,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -3859,11 +4985,11 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_03_01.models.WeekDay - :param hour_slots: hour slots in a day. - :type hour_slots: list[int] + :vartype day: str or ~azure.mgmt.containerservice.v2021_03_01.models.WeekDay + :ivar hour_slots: hour slots in a day. + :vartype hour_slots: list[int] """ _attribute_map = { @@ -3878,6 +5004,13 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: A day in a week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_03_01.models.WeekDay + :keyword hour_slots: hour slots in a day. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -3886,10 +5019,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """The time span with start and end properties. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -3904,6 +5037,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py index 5861176d4972..40c41f468299 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. The operation returns properties @@ -65,7 +332,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -73,36 +341,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,19 +385,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the agent pool. Gets the details of the agent pool by managed cluster and resource group. @@ -153,28 +419,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,49 +444,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -248,17 +495,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -273,15 +522,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -294,28 +547,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -327,43 +573,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -376,14 +612,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -396,15 +633,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -419,22 +658,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,16 +677,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets upgrade profile for an agent pool. Gets the details of the upgrade profile for an agent pool with a specified resource group and @@ -477,28 +709,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,15 +734,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrade node image version of an agent pool to the latest. Upgrade node image version of an agent pool to the latest. @@ -647,15 +854,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -670,25 +880,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,4 +902,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py index db7dbf074733..1d359cca90a3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. The operation @@ -62,8 +220,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -71,36 +231,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,19 +275,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the maintenance configuration. Gets the details of maintenance configurations by managed cluster and resource group. @@ -151,28 +309,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -186,17 +334,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configurations. Creates or updates a maintenance configuration in the specified managed cluster. @@ -220,33 +370,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -260,16 +400,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes the maintenance configuration in the specified managed cluster. @@ -290,28 +432,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -323,3 +455,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py index 3592c69d5251..470c514b06ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py @@ -5,25 +5,738 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,13 +760,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_os_options( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OSOptionProfile" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": """Gets supported OS options in the specified subscription. Gets supported OS options in the specified subscription. @@ -72,28 +785,17 @@ def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -107,21 +809,25 @@ def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -129,34 +835,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -174,17 +875,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. The operation returns @@ -193,8 +895,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -202,35 +906,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -248,18 +948,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets upgrade profile for a managed cluster. Gets the details of the upgrade profile for a managed cluster with a specified resource group @@ -279,27 +980,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -313,16 +1004,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified @@ -348,28 +1041,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -383,15 +1066,17 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster admin credential of a managed cluster. Gets cluster admin credential of the managed cluster with a specified resource group and name. @@ -410,27 +1095,17 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -444,15 +1119,17 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster user credential of a managed cluster. Gets cluster user credential of the managed cluster with a specified resource group and name. @@ -471,27 +1148,17 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -505,15 +1172,17 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.CredentialResults": """Gets cluster monitoring user credential of a managed cluster. Gets cluster monitoring user credential of the managed cluster with a specified resource group @@ -533,27 +1202,17 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -567,15 +1226,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @@ -594,27 +1255,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,47 +1279,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -686,16 +1328,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster with the specified configuration for agents and Kubernetes @@ -709,15 +1353,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -729,27 +1378,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -761,47 +1404,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -815,16 +1448,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -837,15 +1472,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -857,27 +1497,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -889,41 +1523,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -936,13 +1560,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -953,15 +1578,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -975,21 +1602,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1001,47 +1621,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - # 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') + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1054,14 +1664,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -1072,18 +1683,22 @@ def begin_reset_service_principal_profile( :type resource_name: str :param parameters: Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1095,24 +1710,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1124,47 +1733,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1177,14 +1776,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1198,15 +1798,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1218,24 +1821,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1247,41 +1844,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1294,13 +1881,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1311,15 +1899,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1333,21 +1923,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1359,41 +1942,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1406,13 +1979,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stop Managed Cluster. Stops a Running Managed Cluster. @@ -1423,15 +1997,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1445,21 +2021,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1471,41 +2040,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1518,13 +2077,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Start Managed Cluster. Starts a Stopped Managed Cluster. @@ -1535,15 +2095,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1557,21 +2119,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1583,47 +2138,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore def _run_command_initial( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1639,16 +2184,18 @@ def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace def begin_run_command( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: """Run Command against Managed Kubernetes Service. Submit a command to run against managed kubernetes service, it will create a pod to run the @@ -1662,15 +2209,20 @@ def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_03_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1682,27 +2234,21 @@ def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1714,16 +2260,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace def get_command_result( self, - resource_group_name, # type: str - resource_name, # type: str - command_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: """Get command result. Get command result from previous runCommand invoke. @@ -1744,28 +2291,18 @@ def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1781,4 +2318,6 @@ def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py index f6ae3d0c4367..92c323251245 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_03_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -62,30 +90,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +128,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py index c6f1dd0ec7e2..acd130f330cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. Gets a list of private endpoint connections in the specified managed cluster. The operation @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the private endpoint connection. Gets the details of the private endpoint connection by managed cluster and resource group. @@ -136,28 +286,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -171,17 +311,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection in the specified managed cluster. @@ -204,33 +346,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -244,43 +376,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,14 +416,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes the private endpoint connection in the specified managed cluster. @@ -313,15 +437,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -336,22 +462,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,4 +481,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py index d8cce5276be5..cd07d33797bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. Gets a list of private link resources in the specified managed cluster. The operation returns @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py index 228efa82b1bb..f811b853c14d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID the specified managed cluster. @@ -73,32 +120,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -112,4 +149,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py index 9a90721ebc2b..dd16026a0f73 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_container_service_client.py index c6f8ea5a9a81..b49f5eaf87a3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_container_service_client.py @@ -6,104 +6,102 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_05_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_05_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_05_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_05_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_05_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_05_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_05_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_05_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_05_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_05_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_05_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_05_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_metadata.json index 3fa743352586..479706093eb6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py index de11b983ca12..0c469ff14a67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_container_service_client.py index 6134e940c073..3d3596cbd9cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_container_service_client.py @@ -6,100 +6,103 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_05_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_05_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_05_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_05_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_05_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_05_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_05_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_05_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_05_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_05_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_05_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_05_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_05_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py index e3aa21c489dc..ef5cca693cd0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -59,7 +65,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -67,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -114,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -181,8 +177,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -196,33 +194,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -240,8 +228,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -264,15 +255,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -285,28 +281,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -318,6 +307,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -332,28 +322,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -366,6 +346,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -385,15 +367,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -408,22 +392,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -435,8 +411,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -464,28 +442,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +467,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -635,15 +591,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -658,25 +618,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -688,4 +640,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py index e8c0d7389557..0e5cf700664c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -56,8 +62,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -65,36 +73,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -144,28 +151,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -179,8 +176,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -211,33 +211,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -251,8 +241,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -280,28 +273,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,3 +296,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py index 2d4702b66e1c..9a473d230f6e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_outbound_network_dependencies_endpoints_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get_os_options( self, location: str, @@ -67,28 +73,17 @@ async def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -102,8 +97,11 @@ async def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -113,8 +111,10 @@ def list( Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -122,34 +122,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -167,11 +162,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -184,8 +181,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -193,35 +192,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -239,11 +234,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -268,27 +265,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -302,8 +289,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -334,28 +324,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +349,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -398,29 +381,18 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -434,8 +406,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -463,29 +438,18 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +463,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -528,29 +495,18 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -564,8 +520,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -590,27 +549,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -624,8 +573,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -638,32 +589,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -681,8 +622,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -702,15 +646,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -722,27 +671,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -754,6 +697,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -768,32 +712,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -807,8 +741,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -828,15 +765,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -848,27 +790,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -880,6 +816,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -893,27 +830,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -926,6 +853,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -942,15 +871,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -964,21 +895,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -990,6 +914,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -1004,32 +929,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1042,6 +957,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -1058,18 +975,22 @@ async def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1081,24 +1002,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1110,6 +1025,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1124,32 +1040,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1162,6 +1068,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1181,15 +1089,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1201,24 +1112,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1230,6 +1135,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1243,27 +1149,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1276,6 +1172,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1293,15 +1191,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1315,21 +1215,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,6 +1234,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1354,27 +1248,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1387,6 +1271,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1407,15 +1293,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1429,21 +1317,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1455,6 +1336,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1468,27 +1350,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1501,6 +1373,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1518,15 +1392,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1540,21 +1416,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,6 +1435,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore async def _run_command_initial( @@ -1580,32 +1450,22 @@ async def _run_command_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1621,8 +1481,11 @@ async def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async async def begin_run_command( self, resource_group_name: str, @@ -1644,15 +1507,20 @@ async def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_05_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1664,27 +1532,21 @@ async def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1696,8 +1558,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace_async async def get_command_result( self, resource_group_name: str, @@ -1725,28 +1589,18 @@ async def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1762,15 +1616,19 @@ async def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1780,8 +1638,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1789,36 +1649,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1836,6 +1693,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py index fd64291b851e..8f6b5912ba60 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -59,30 +66,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -100,6 +104,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py index 8c5611dd5adf..ccc5bcf1f311 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -131,28 +129,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -166,8 +154,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -198,33 +189,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -238,8 +219,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -252,28 +235,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -286,6 +259,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -305,15 +280,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -328,22 +305,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -355,4 +324,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py index b8283cdfee17..c5aa9d598d03 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py index 55150ba5ee1c..5f87b0ed0eaa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -67,32 +72,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -106,4 +101,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/__init__.py index 92a927ea3e9b..89a1af66110f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/__init__.py @@ -6,168 +6,87 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudErrorBody - from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 - from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import EndpointDependency - from ._models_py3 import EndpointDetail - from ._models_py3 import ExtendedLocation - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterHTTPProxyConfig - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningError - from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import OSOptionProfile - from ._models_py3 import OSOptionProperty - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OutboundEnvironmentEndpoint - from ._models_py3 import OutboundEnvironmentEndpointCollection - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import RunCommandRequest - from ._models_py3 import RunCommandResult - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import Components1Q1Og48SchemasManagedclusterAllof1 # type: ignore - from ._models import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import EndpointDependency # type: ignore - from ._models import EndpointDetail # type: ignore - from ._models import ExtendedLocation # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterHTTPProxyConfig # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import OSOptionProfile # type: ignore - from ._models import OSOptionProperty # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OutboundEnvironmentEndpoint # type: ignore - from ._models import OutboundEnvironmentEndpointCollection # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import RunCommandRequest # type: ignore - from ._models import RunCommandResult # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudErrorBody +from ._models_py3 import Components1Q1Og48SchemasManagedclusterAllof1 +from ._models_py3 import Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties +from ._models_py3 import ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_container_service_client_enums.py index 5590a8b36cfb..35b63e247154 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools @@ -39,7 +24,7 @@ class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: User agent pools are primarily for hosting your application pods. USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of Agent Pool. """ @@ -48,7 +33,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use of this is strongly discouraged. AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ @@ -57,7 +42,7 @@ class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The cluster is stopped. STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -66,7 +51,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice of orchestrator. """ @@ -74,7 +59,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. Note: This is no longer maintained. """ @@ -253,7 +238,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -262,7 +247,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -271,7 +256,7 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'random'. See `expanders `_ for more information. @@ -294,13 +279,13 @@ class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Used when you don't have a particular need for the node groups to scale differently. RANDOM = "random" -class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of extendedLocation. """ EDGE_ZONE = "EdgeZone" -class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. """ @@ -310,7 +295,7 @@ class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIG4_G = "MIG4g" MIG7_G = "MIG7g" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. """ @@ -320,7 +305,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Kubelet will use the temporary disk for its data. TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. """ @@ -330,7 +315,7 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Enables Azure Hybrid User Benefits for Windows VMs. WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. @@ -343,7 +328,7 @@ class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use a basic Load Balancer with limited functionality. BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -352,13 +337,13 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'Free'. See `uptime SLA `_ for more details. """ @@ -369,7 +354,7 @@ class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This cannot be specified if networkPlugin is anything other than 'azure'. """ @@ -380,7 +365,7 @@ class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: This is no longer supported. BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building the Kubernetes network. """ @@ -393,7 +378,7 @@ class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: information. KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building the Kubernetes network. """ @@ -406,7 +391,7 @@ class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: for more information. AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS @@ -422,14 +407,14 @@ class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: provides lower read/write latency, along with faster node scaling and cluster upgrades. EPHEMERAL = "Ephemeral" -class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies an OS SKU. This value must not be specified if OSType is Windows. """ UBUNTU = "Ubuntu" CBL_MARINER = "CBLMariner" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The operating system type. The default is Linux. """ @@ -438,7 +423,7 @@ class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use Windows. WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This can only be set at cluster creation time and cannot be changed later. For more information see `egress outbound type `_. """ @@ -453,7 +438,7 @@ class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: `_. USER_DEFINED_ROUTING = "userDefinedRouting" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -462,7 +447,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `use managed identities in AKS `_. """ @@ -478,7 +463,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. NONE = "None" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see `spot VMs `_ @@ -491,7 +476,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: cause issues with cluster scaling or upgrading. DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Virtual Machine Scale Set priority. """ @@ -501,7 +486,7 @@ class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Regular VMs will be used. REGULAR = "Regular" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `setting the AKS cluster auto-upgrade channel `_. """ @@ -531,7 +516,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models.py deleted file mode 100644 index 9aee8b4f07a9..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models.py +++ /dev/null @@ -1,3750 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: The type of Agent Pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the agent pool version list. - :vartype id: str - :ivar name: The name of the agent pool version list. - :vartype name: str - :ivar type: Type of the agent pool version list. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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 ID of the agent pool upgrade profile. - :vartype id: str - :ivar name: The name of the agent pool upgrade profile. - :vartype name: str - :ivar type: The type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). - If a percentage is specified, it is the percentage of the total agent pool size at the time of - the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is - 1. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_05_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): - """Components1Q1Og48SchemasManagedclusterAllof1. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions - cannot be skipped. All upgrades must be performed sequentially by major version number. For - example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> - 1.16.x is not allowed. See `upgrading an AKS cluster - `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str - :ivar fqdn: The FQDN of the master pool. - :vartype fqdn: str - :ivar private_fqdn: The FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) - headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. - This special FQDN supports CORS, allowing the Azure Portal to function properly. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity - `_ for more details on AAD pod - identity integration. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_05_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for - this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details - see `disable local accounts - `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterHTTPProxyConfig - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'readonly': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - - -class Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """Details about a user assigned identity. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): - """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(**kwargs) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_05_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. - Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type - `_. Possible values include: - "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs - `_ for more information about the - differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. A maximum of 1 key may be specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_05_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class EndpointDependency(msrest.serialization.Model): - """A domain name that AKS agent nodes are reaching at. - - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDependency, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class EndpointDetail(msrest.serialization.Model): - """connect information from the AKS agent nodes to a single endpoint. - - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDetail, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - self.port = kwargs.get('port', None) - self.protocol = kwargs.get('protocol', None) - self.description = kwargs.get('description', None) - - -class ExtendedLocation(msrest.serialization.Model): - """The complex type of the extended location. - - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocationTypes - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtendedLocation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class KubeletConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies - `_ - for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal - numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported - units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is - 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default - is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager - `_. The default is - 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_05_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The - default is 'always'. For more information see `Transparent Hugepages - `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', - 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent - Hugepages - `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """See `planned maintenance `_ for more information about planned maintenance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_05_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied - configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): - """Managed cluster. - - Variables are only 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 identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions - cannot be skipped. All upgrades must be performed sequentially by major version number. For - example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> - 1.16.x is not allowed. See `upgrading an AKS cluster - `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str - :ivar fqdn: The FQDN of the master pool. - :vartype fqdn: str - :ivar private_fqdn: The FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) - headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. - This special FQDN supports CORS, allowing the Azure Portal to function properly. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity - `_ for more details on AAD pod - identity integration. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_05_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for - this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details - see `disable local accounts - `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterHTTPProxyConfig - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocation - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - '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': 'ManagedClusterSKU'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """For more details see `managed AAD on AKS `_. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. - This feature is not compatible with clusters that use Public IP Per Node, or clusters that are - using a Basic Load Balancer. For more information see `API server authorized IP ranges - `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster - `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private - cluster or not. - :type enable_private_cluster_public_fqdn: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel - `_. Possible - values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_05_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): - """Cluster HTTP proxy configuration. - - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str - """ - - _attribute_map = { - 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, - 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, - 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, - 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) - self.http_proxy = kwargs.get('http_proxy', None) - self.https_proxy = kwargs.get('https_proxy', None) - self.no_proxy = kwargs.get('no_proxy', None) - self.trusted_ca = kwargs.get('trusted_ca', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS - `_. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_05_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed - values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in - Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """Details about the pod identity assigned to the Managed Cluster. - - Variables are only 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 name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_05_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.binding_selector = kwargs.get('binding_selector', None) - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """See `use AAD pod identity `_ for more details on pod identity integration. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the - security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet - network plugin with AAD Pod Identity - `_ - for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders - `_ - for more information. Possible values include: "least-waste", "most-pods", "priority", - "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_05_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to - act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore - unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer - followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by - an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an - integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed - by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """The SKU of a Managed Cluster. - - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA - `_ for more details. Possible values include: - "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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 ID of the upgrade profile. - :vartype id: str - :ivar name: The name of the upgrade profile. - :vartype name: str - :ivar type: The type of the upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Possible values - include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo - `_. - :type enable_csi_proxy: bool - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) - - -class OperationListResult(msrest.serialization.Model): - """The List Operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_05_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the operation. - :vartype origin: str - :ivar name: The name of the operation. - :vartype name: str - :ivar operation: The display name of the operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSOptionProfile(msrest.serialization.Model): - """The OS option profile. - - Variables are only 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 ID of the OS option resource. - :vartype id: str - :ivar name: The name of the OS option resource. - :vartype name: str - :ivar type: The type of the OS option resource. - :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: - list[~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProperty] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.os_option_property_list = kwargs['os_option_property_list'] - - -class OSOptionProperty(msrest.serialization.Model): - """OS option property. - - All required parameters must be populated in order to send to Azure. - - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool - """ - - _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, - } - - _attribute_map = { - 'os_type': {'key': 'os-type', 'type': 'str'}, - 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProperty, self).__init__(**kwargs) - self.os_type = kwargs['os_type'] - self.enable_fips_image = kwargs['enable_fips_image'] - - -class OutboundEnvironmentEndpoint(msrest.serialization.Model): - """Egress endpoints which AKS agent nodes connect to for common purpose. - - :param category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDependency] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): - """Collection of OutboundEnvironmentEndpoint. - - Variables are only 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 value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_05_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource ID of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_05_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class RunCommandRequest(msrest.serialization.Model): - """A run command request. - - All required parameters must be populated in order to send to Azure. - - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str - """ - - _validation = { - 'command': {'required': True}, - } - - _attribute_map = { - 'command': {'key': 'command', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandRequest, self).__init__(**kwargs) - self.command = kwargs['command'] - self.context = kwargs.get('context', None) - self.cluster_token = kwargs.get('cluster_token', None) - - -class RunCommandResult(msrest.serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: The exit code of the command. - :vartype exit_code: int - :ivar started_at: The time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: The time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: The command output. - :vartype logs: str - :ivar reason: An explanation of why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'exit_code': {'readonly': True}, - 'started_at': {'readonly': True}, - 'finished_at': {'readonly': True}, - 'logs': {'readonly': True}, - 'reason': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, - 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, - 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, - 'logs': {'key': 'properties.logs', 'type': 'str'}, - 'reason': {'key': 'properties.reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandResult, self).__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_05_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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.containerservice.v2021_05_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_05_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour - ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 - UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py index ff6c3abb01dc..0d0cb915dd5c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,128 +64,129 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type_properties_type: The type of Agent Pool. Possible values include: + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type_properties_type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile """ @@ -277,6 +280,127 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -327,8 +451,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool version list. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -351,6 +475,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -361,12 +490,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -383,6 +512,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -394,8 +531,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -415,6 +552,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -433,16 +574,16 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str """ _validation = { @@ -472,6 +613,18 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: The latest AKS supported node image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -485,10 +638,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -503,6 +656,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -511,12 +670,12 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -529,6 +688,14 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -536,17 +703,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_05_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_05_01.models.CloudErrorBody] """ _attribute_map = { @@ -565,6 +732,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_05_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -577,24 +757,24 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str + :vartype kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str :ivar fqdn: The FQDN of the master pool. :vartype fqdn: str :ivar private_fqdn: The FQDN of private cluster. @@ -603,65 +783,65 @@ class Components1Q1Og48SchemasManagedclusterAllof1(msrest.serialization.Model): headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity + :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. - :type pod_identity_profile: + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: + :ivar disk_encryption_set_id: This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_05_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterHTTPProxyConfig """ @@ -734,6 +914,82 @@ def __init__( http_proxy_config: Optional["ManagedClusterHTTPProxyConfig"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_05_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterHTTPProxyConfig + """ super(Components1Q1Og48SchemasManagedclusterAllof1, self).__init__(**kwargs) self.identity = identity self.provisioning_state = None @@ -791,6 +1047,8 @@ def __init__( self, **kwargs ): + """ + """ super(Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -799,12 +1057,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """Details about a user assigned identity. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -821,6 +1079,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -830,12 +1096,12 @@ def __init__( class ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties(UserAssignedIdentity): """ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -852,6 +1118,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -860,8 +1134,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceVMDiagnostics """ @@ -879,6 +1153,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -888,10 +1167,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -911,6 +1190,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -923,12 +1209,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_05_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_05_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -966,21 +1252,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -1009,13 +1295,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_05_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -1030,37 +1377,38 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building the Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building the Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPolicy + :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type + :vartype docker_bridge_cidr: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type `_. Possible values include: "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OutboundType + :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_05_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfile """ @@ -1099,6 +1447,41 @@ def __init__( load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building the Kubernetes network. Possible + values include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building the Kubernetes network. Possible + values include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkPolicy + :keyword network_mode: This cannot be specified if networkPlugin is anything other than + 'azure'. Possible values include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting". Default value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OutboundType + :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_05_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -1117,9 +1500,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshPublicKey] """ @@ -1137,6 +1520,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. A maximum of 1 key may be specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -1146,9 +1535,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -1165,6 +1554,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -1176,8 +1570,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -1198,6 +1592,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -1228,6 +1626,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1254,6 +1654,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1261,10 +1663,10 @@ def __init__( class EndpointDependency(msrest.serialization.Model): """A domain name that AKS agent nodes are reaching at. - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDetail] + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDetail] """ _attribute_map = { @@ -1279,6 +1681,13 @@ def __init__( endpoint_details: Optional[List["EndpointDetail"]] = None, **kwargs ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDetail] + """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name self.endpoint_details = endpoint_details @@ -1287,14 +1696,14 @@ def __init__( class EndpointDetail(msrest.serialization.Model): """connect information from the AKS agent nodes to a single endpoint. - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str """ _attribute_map = { @@ -1313,6 +1722,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ super(EndpointDetail, self).__init__(**kwargs) self.ip_address = ip_address self.port = port @@ -1323,10 +1742,10 @@ def __init__( class ExtendedLocation(msrest.serialization.Model): """The complex type of the extended location. - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocationTypes + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1341,6 +1760,12 @@ def __init__( type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocationTypes + """ super(ExtendedLocation, self).__init__(**kwargs) self.name = name self.type = type @@ -1349,40 +1774,40 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies `_ for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager `_. The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1419,6 +1844,42 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1436,19 +1897,19 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_05_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_05_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1467,6 +1928,21 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_05_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1488,11 +1964,11 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system metadata relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_05_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied + :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeSpan] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeSpan] """ _validation = { @@ -1518,6 +1994,13 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_05_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1529,8 +2012,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1550,6 +2033,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1568,10 +2056,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1596,6 +2084,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1611,24 +2105,24 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): All required parameters must be populated in order to send to Azure. - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str + :vartype kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str :ivar fqdn: The FQDN of the master pool. :vartype fqdn: str :ivar private_fqdn: The FQDN of private cluster. @@ -1637,65 +2131,65 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity + :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. - :type pod_identity_profile: + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: + :ivar disk_encryption_set_id: This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_05_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterHTTPProxyConfig :ivar id: Resource Id. :vartype id: str @@ -1703,14 +2197,14 @@ class ManagedCluster(Resource, Components1Q1Og48SchemasManagedclusterAllof1): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocation + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocation """ _validation = { @@ -1797,6 +2291,90 @@ def __init__( extended_location: Optional["ExtendedLocation"] = None, **kwargs ): + """ + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_05_01.models.ComponentsQit0EtSchemasManagedclusterpropertiesPropertiesIdentityprofileAdditionalproperties] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterHTTPProxyConfig + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: ~azure.mgmt.containerservice.v2021_05_01.models.ExtendedLocation + """ super(ManagedCluster, self).__init__(location=location, tags=tags, identity=identity, kubernetes_version=kubernetes_version, dns_prefix=dns_prefix, fqdn_subdomain=fqdn_subdomain, agent_pool_profiles=agent_pool_profiles, linux_profile=linux_profile, windows_profile=windows_profile, service_principal_profile=service_principal_profile, addon_profiles=addon_profiles, pod_identity_profile=pod_identity_profile, node_resource_group=node_resource_group, enable_rbac=enable_rbac, enable_pod_security_policy=enable_pod_security_policy, network_profile=network_profile, aad_profile=aad_profile, auto_upgrade_profile=auto_upgrade_profile, auto_scaler_profile=auto_scaler_profile, api_server_access_profile=api_server_access_profile, disk_encryption_set_id=disk_encryption_set_id, identity_profile=identity_profile, private_link_resources=private_link_resources, disable_local_accounts=disable_local_accounts, http_proxy_config=http_proxy_config, **kwargs) self.identity = identity self.provisioning_state = None @@ -1841,22 +2419,22 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """For more details see `managed AAD on AKS `_. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1881,6 +2459,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1904,12 +2500,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1936,6 +2532,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1947,10 +2551,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAddonProfileIdentity @@ -1974,6 +2578,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1983,12 +2593,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -2005,6 +2615,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -2013,127 +2631,128 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile """ @@ -2221,6 +2840,126 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2267,130 +3006,131 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_05_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str + :ivar name: Required. Windows agent pool names must be 6 characters or less. + :vartype name: str """ _validation = { @@ -2480,6 +3220,128 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.KubeletDiskType + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_05_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_05_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_05_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_05_01.models.GPUInstanceProfile + :keyword name: Required. Windows agent pool names must be 6 characters or less. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, **kwargs) self.name = name @@ -2487,21 +3349,21 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see `API server authorized IP ranges `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private cluster or not. - :type enable_private_cluster_public_fqdn: bool + :vartype enable_private_cluster_public_fqdn: bool """ _attribute_map = { @@ -2520,6 +3382,23 @@ def __init__( enable_private_cluster_public_fqdn: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :paramtype enable_private_cluster_public_fqdn: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2530,10 +3409,10 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. Possible values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_05_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_05_01.models.UpgradeChannel """ _attribute_map = { @@ -2546,6 +3425,13 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Possible values include: "rapid", "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_05_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2553,14 +3439,14 @@ def __init__( class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): """Cluster HTTP proxy configuration. - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str """ _attribute_map = { @@ -2579,6 +3465,16 @@ def __init__( trusted_ca: Optional[str] = None, **kwargs ): + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) self.http_proxy = http_proxy self.https_proxy = https_proxy @@ -2597,13 +3493,13 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS + :ivar type: For more information see `use managed identities in AKS `_. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: + :vartype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_05_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] """ @@ -2626,6 +3522,16 @@ def __init__( user_assigned_identities: Optional[Dict[str, "Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, **kwargs ): + """ + :keyword type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_05_01.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_05_01.models.Components1Umhcm8SchemasManagedclusteridentityPropertiesUserassignedidentitiesAdditionalproperties] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2638,8 +3544,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2659,6 +3565,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2667,27 +3577,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2715,6 +3624,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] + :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2727,9 +3659,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + :ivar count: The desired number of outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2746,6 +3678,12 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2753,8 +3691,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] """ @@ -2768,6 +3706,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2775,8 +3718,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] """ _attribute_map = { @@ -2789,6 +3732,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_05_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2800,14 +3747,14 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_05_01.models.UserAssignedIdentity + :ivar name: Required. The name of the pod identity. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. The user assigned identity details. + :vartype identity: ~azure.mgmt.containerservice.v2021_05_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2843,6 +3790,16 @@ def __init__( binding_selector: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The name of the pod identity. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. The user assigned identity details. + :paramtype identity: ~azure.mgmt.containerservice.v2021_05_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2857,12 +3814,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. The name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. The pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2885,6 +3842,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. The name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. The pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2894,19 +3859,19 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """See `use AAD pod identity `_ for more details on pod identity integration. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity `_ for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: The pod identities to use in the cluster. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityException] """ @@ -2926,6 +3891,22 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: The pod identities to use in the cluster. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2936,8 +3917,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param error: Details about the error. - :type error: + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ @@ -2951,6 +3932,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) self.error = error @@ -2958,17 +3944,17 @@ def __init__( class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ @@ -2988,6 +3974,20 @@ def __init__( details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -2998,8 +3998,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningError """ @@ -3013,6 +4013,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPodIdentityProvisioningError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -3022,15 +4027,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :vartype name: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -3055,6 +4060,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :paramtype name: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -3065,10 +4082,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -3083,6 +4100,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -3091,53 +4114,52 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar expander: If not specified, the default is 'random'. See `expanders `_ for more information. Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_05_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + :vartype expander: str or ~azure.mgmt.containerservice.v2021_05_01.models.Expander + :ivar max_empty_bulk_delete: The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -3182,6 +4204,55 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_05_01.models.Expander + :keyword max_empty_bulk_delete: The default is 10. + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: The default is 600. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -3207,10 +4278,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -3229,6 +4300,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -3237,12 +4314,12 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """The SKU of a Managed Cluster. - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA + :ivar name: The name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA `_ for more details. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUTier + :vartype tier: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -3257,6 +4334,14 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: The name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -3275,12 +4360,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3307,6 +4392,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3320,29 +4414,29 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + :vartype admin_password: str + :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.LicenseType + :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. - :type enable_csi_proxy: bool + :vartype enable_csi_proxy: bool """ _validation = { @@ -3365,6 +4459,31 @@ def __init__( enable_csi_proxy: Optional[bool] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.LicenseType + :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :paramtype enable_csi_proxy: bool + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3393,6 +4512,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3438,6 +4559,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3460,8 +4583,8 @@ class OSOptionProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the OS option resource. :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: + :ivar os_option_property_list: Required. The list of OS options. + :vartype os_option_property_list: list[~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProperty] """ @@ -3485,6 +4608,11 @@ def __init__( os_option_property_list: List["OSOptionProperty"], **kwargs ): + """ + :keyword os_option_property_list: Required. The list of OS options. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProperty] + """ super(OSOptionProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3497,10 +4625,10 @@ class OSOptionProperty(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool + :ivar os_type: Required. The OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether the image is FIPS-enabled. + :vartype enable_fips_image: bool """ _validation = { @@ -3520,6 +4648,12 @@ def __init__( enable_fips_image: bool, **kwargs ): + """ + :keyword os_type: Required. The OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether the image is FIPS-enabled. + :paramtype enable_fips_image: bool + """ super(OSOptionProperty, self).__init__(**kwargs) self.os_type = os_type self.enable_fips_image = enable_fips_image @@ -3528,11 +4662,11 @@ def __init__( class OutboundEnvironmentEndpoint(msrest.serialization.Model): """Egress endpoints which AKS agent nodes connect to for common purpose. - :param category: The category of endpoints accessed by the AKS agent node, e.g. + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDependency] + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDependency] """ _attribute_map = { @@ -3547,6 +4681,13 @@ def __init__( endpoints: Optional[List["EndpointDependency"]] = None, **kwargs ): + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: list[~azure.mgmt.containerservice.v2021_05_01.models.EndpointDependency] + """ super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) self.category = category self.endpoints = endpoints @@ -3559,8 +4700,9 @@ class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpoint] + :ivar value: Required. Collection of resources. + :vartype value: + list[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3581,6 +4723,11 @@ def __init__( value: List["OutboundEnvironmentEndpoint"], **kwargs ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpoint] + """ super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) self.value = value self.next_link = None @@ -3589,9 +4736,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_05_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_05_01.models.Code """ _attribute_map = { @@ -3604,6 +4751,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_05_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3611,8 +4763,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource ID of the private endpoint. - :type id: str + :ivar id: The resource ID of the private endpoint. + :vartype id: str """ _attribute_map = { @@ -3625,6 +4777,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3644,11 +4800,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkServiceConnectionState """ @@ -3675,6 +4831,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3687,8 +4851,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3701,6 +4865,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3710,16 +4879,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3748,6 +4917,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3760,8 +4941,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3774,6 +4955,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3781,11 +4966,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_05_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_05_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3800,6 +4985,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_05_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3808,8 +5000,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3822,6 +5014,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3831,12 +5027,12 @@ class RunCommandRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str + :ivar command: Required. The command to run. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str """ _validation = { @@ -3857,6 +5053,14 @@ def __init__( cluster_token: Optional[str] = None, **kwargs ): + """ + :keyword command: Required. The command to run. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ super(RunCommandRequest, self).__init__(**kwargs) self.command = command self.context = context @@ -3908,6 +5112,8 @@ def __init__( self, **kwargs ): + """ + """ super(RunCommandResult, self).__init__(**kwargs) self.id = None self.provisioning_state = None @@ -3921,62 +5127,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -4043,6 +5249,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -4077,21 +5341,21 @@ def __init__( 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.containerservice.v2021_05_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.CreatedByType + :ivar created_at: The UTC timestamp of resource creation. + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_05_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -4114,6 +5378,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.CreatedByType + :keyword created_at: The UTC timestamp of resource creation. + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_05_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -4126,8 +5408,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -4140,6 +5422,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -4147,13 +5433,13 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_05_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + :vartype day: str or ~azure.mgmt.containerservice.v2021_05_01.models.WeekDay + :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] + :vartype hour_slots: list[int] """ _attribute_map = { @@ -4168,6 +5454,15 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_05_01.models.WeekDay + :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -4176,10 +5471,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -4194,6 +5489,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py index 35911eea6d77..9a91a38fcc80 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. @@ -64,7 +331,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -72,36 +340,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,19 +384,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the specified managed cluster agent pool. Gets the specified managed cluster agent pool. @@ -152,28 +418,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,49 +443,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -247,17 +494,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool in the specified managed cluster. Creates or updates an agent pool in the specified managed cluster. @@ -272,15 +521,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -293,28 +546,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -326,43 +572,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-05-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -375,14 +611,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool in the specified managed cluster. Deletes an agent pool in the specified managed cluster. @@ -395,15 +632,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -418,22 +657,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -445,16 +676,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets the upgrade profile for an agent pool. Gets the upgrade profile for an agent pool. @@ -475,28 +707,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,15 +732,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported Kubernetes versions for the specified agent pool. See `supported Kubernetes versions @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrades the node image version of an agent pool to the latest. Upgrading the node image version of an agent pool applies the newest OS and runtime updates to @@ -649,15 +856,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -672,25 +882,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,4 +904,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py index 304c6b195833..25d6716a4a24 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -61,8 +219,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -70,36 +230,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,19 +274,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the specified maintenance configuration of a managed cluster. Gets the specified maintenance configuration of a managed cluster. @@ -150,28 +308,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,17 +333,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configuration in the specified managed cluster. Creates or updates a maintenance configuration in the specified managed cluster. @@ -218,33 +368,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -258,16 +398,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes a maintenance configuration. @@ -288,28 +430,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,3 +453,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py index fa0d76950e13..2e4d9b8591dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py @@ -5,25 +5,785 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,13 +807,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_os_options( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OSOptionProfile" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": """Gets supported OS options in the specified subscription. Gets supported OS options in the specified subscription. @@ -72,28 +832,17 @@ def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -107,20 +856,24 @@ def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -128,34 +881,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -173,17 +921,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. @@ -191,8 +940,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -200,35 +951,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -246,18 +993,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets the upgrade profile of a managed cluster. Gets the upgrade profile of a managed cluster. @@ -276,27 +1024,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,16 +1048,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials @@ -343,28 +1083,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,16 +1108,18 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the admin credentials of a managed cluster. Lists the admin credentials of a managed cluster. @@ -408,29 +1140,18 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -444,16 +1165,18 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the user credentials of a managed cluster. Lists the user credentials of a managed cluster. @@ -474,29 +1197,18 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,16 +1222,18 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the cluster monitoring user credentials of a managed cluster. Lists the cluster monitoring user credentials of a managed cluster. @@ -540,29 +1254,18 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -576,15 +1279,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets a managed cluster. @@ -603,27 +1308,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -637,47 +1332,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -695,16 +1381,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster. @@ -717,15 +1405,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -737,27 +1430,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -769,47 +1456,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -823,16 +1500,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates tags on a managed cluster. @@ -845,15 +1524,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -865,27 +1549,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -897,41 +1575,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-05-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -944,13 +1612,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes a managed cluster. @@ -961,15 +1630,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -983,21 +1654,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1009,47 +1673,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1062,14 +1716,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the Service Principal Profile of a managed cluster. This action cannot be performed on a cluster that is not using a service principal. @@ -1079,18 +1734,22 @@ def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1102,24 +1761,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1131,47 +1784,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1184,14 +1827,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. Reset the AAD Profile of a managed cluster. @@ -1204,15 +1848,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1224,24 +1871,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1253,41 +1894,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-05-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1300,13 +1931,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotates the certificates of a managed cluster. See `Certificate rotation `_ for @@ -1318,15 +1950,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1340,21 +1974,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,41 +1993,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-05-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1413,13 +2030,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stops a Managed Cluster. This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a @@ -1434,15 +2052,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1456,21 +2076,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,41 +2095,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-05-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1529,13 +2132,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Starts a previously stopped Managed Cluster. See `starting a cluster `_ for more @@ -1547,15 +2151,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1569,21 +2175,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1595,47 +2194,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore def _run_command_initial( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1651,16 +2240,18 @@ def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace def begin_run_command( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: """Submits a command to run against the Managed Cluster. AKS will create a pod to run the command. This is primarily useful for private clusters. For @@ -1675,15 +2266,20 @@ def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_05_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1695,27 +2291,21 @@ def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1727,16 +2317,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace def get_command_result( self, - resource_group_name, # type: str - resource_name, # type: str - command_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: """Gets the results of a command which has been run on the Managed Cluster. Gets the results of a command which has been run on the Managed Cluster. @@ -1757,28 +2348,18 @@ def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1794,16 +2375,19 @@ def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1813,8 +2397,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1822,36 +2408,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1869,6 +2452,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py index 4932d0d0e94b..555de2b2d6a8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,18 +72,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of operations. Gets a list of operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_05_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -64,30 +92,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,6 +130,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py index 32afc4933599..e76963599d6a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. To learn more about private clusters, see: @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection. To learn more about private clusters, see: @@ -137,28 +287,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -172,17 +312,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection. @@ -205,33 +347,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -245,43 +377,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-05-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,14 +417,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes a private endpoint connection. @@ -314,15 +438,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -337,22 +463,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -364,4 +482,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py index 842312f3a90f..7038771182f3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. To learn more about private clusters, see: @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py index 7be840c05e18..a10fd05a34c5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID for the specified managed cluster. @@ -72,32 +119,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -111,4 +148,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py index 07afbf85a157..c5df543165c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_container_service_client.py index f6d6b5c7484a..9cf44758b9a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_container_service_client.py @@ -6,104 +6,102 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_07_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_07_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_07_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_07_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_07_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_07_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_07_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_07_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_07_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_07_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_07_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_07_01.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_metadata.json index 3d55a4978276..c7a60b169f58 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py index f7e266a3188b..86739c32e400 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_container_service_client.py index 169392b48bf0..8a411c6d25d2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_container_service_client.py @@ -6,100 +6,103 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_07_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_07_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_07_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_07_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_07_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_07_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_07_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_07_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_07_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_07_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_07_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_07_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_07_01.aio.operations.ResolvePrivateLinkServiceIdOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py index 1d91c5f9a227..920a829b4a2f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -59,7 +65,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -67,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -114,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -181,8 +177,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -196,33 +194,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -240,8 +228,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -264,15 +255,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -285,28 +281,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -318,6 +307,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -332,28 +322,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -366,6 +346,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -385,15 +367,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -408,22 +392,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -435,8 +411,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -464,28 +442,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +467,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -635,15 +591,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -658,25 +618,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -688,4 +640,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py index ac3341c5a79c..62ef34eeed20 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -56,8 +62,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -65,36 +73,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -144,28 +151,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -179,8 +176,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -211,33 +211,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -251,8 +241,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -280,28 +273,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,3 +296,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py index d8a9e18ee86e..3d3610b59ae8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_outbound_network_dependencies_endpoints_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get_os_options( self, location: str, @@ -67,28 +73,17 @@ async def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -102,8 +97,11 @@ async def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -113,8 +111,10 @@ def list( Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -122,34 +122,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -167,11 +162,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -184,8 +181,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -193,35 +192,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -239,11 +234,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -268,27 +265,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -302,8 +289,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -334,28 +324,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +349,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -398,29 +381,18 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -434,8 +406,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -463,29 +438,18 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +463,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -528,29 +495,18 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -564,8 +520,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -590,27 +549,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -624,8 +573,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -638,32 +589,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -681,8 +622,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -702,15 +646,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -722,27 +671,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -754,6 +697,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -768,32 +712,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -807,8 +741,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -828,15 +765,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -848,27 +790,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -880,6 +816,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -893,27 +830,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -926,6 +853,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -942,15 +871,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -964,21 +895,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -990,6 +914,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -1004,32 +929,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1042,6 +957,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -1058,18 +975,22 @@ async def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1081,24 +1002,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1110,6 +1025,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1124,32 +1040,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1162,6 +1068,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1181,15 +1089,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1201,24 +1112,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1230,6 +1135,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1243,27 +1149,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1276,6 +1172,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1293,15 +1191,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1315,21 +1215,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,6 +1234,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1354,27 +1248,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1387,6 +1271,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1407,15 +1293,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1429,21 +1317,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1455,6 +1336,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1468,27 +1350,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1501,6 +1373,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1518,15 +1392,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1540,21 +1416,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,6 +1435,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore async def _run_command_initial( @@ -1580,32 +1450,22 @@ async def _run_command_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1621,8 +1481,11 @@ async def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async async def begin_run_command( self, resource_group_name: str, @@ -1644,15 +1507,20 @@ async def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_07_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1664,27 +1532,21 @@ async def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1696,8 +1558,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace_async async def get_command_result( self, resource_group_name: str, @@ -1725,28 +1589,18 @@ async def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1762,15 +1616,19 @@ async def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1780,8 +1638,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1789,36 +1649,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1836,6 +1693,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py index 91b99d99e7f2..caee9aea5a54 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -59,30 +66,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -100,6 +104,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py index 3a44043241a3..cd3eaef43e21 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -131,28 +129,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -166,8 +154,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -198,33 +189,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -238,8 +219,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -252,28 +235,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -286,6 +259,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -305,15 +280,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -328,22 +305,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -355,4 +324,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py index e42908b0f503..e928e6a63d4f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py index a2569183ede1..01c2fceca3e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -67,32 +72,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -106,4 +101,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/__init__.py index ee70a6503d8b..35d5a286ea52 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/__init__.py @@ -6,172 +6,89 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import EndpointDependency - from ._models_py3 import EndpointDetail - from ._models_py3 import ExtendedLocation - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterHTTPProxyConfig - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterManagedOutboundIPProfile - from ._models_py3 import ManagedClusterNATGatewayProfile - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningError - from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterSecurityProfile - from ._models_py3 import ManagedClusterSecurityProfileAzureDefender - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue - from ._models_py3 import OSOptionProfile - from ._models_py3 import OSOptionProperty - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OutboundEnvironmentEndpoint - from ._models_py3 import OutboundEnvironmentEndpointCollection - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import RunCommandRequest - from ._models_py3 import RunCommandResult - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import EndpointDependency # type: ignore - from ._models import EndpointDetail # type: ignore - from ._models import ExtendedLocation # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterHTTPProxyConfig # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterManagedOutboundIPProfile # type: ignore - from ._models import ManagedClusterNATGatewayProfile # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterSecurityProfile # type: ignore - from ._models import ManagedClusterSecurityProfileAzureDefender # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import OSOptionProfile # type: ignore - from ._models import OSOptionProperty # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OutboundEnvironmentEndpoint # type: ignore - from ._models import OutboundEnvironmentEndpointCollection # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import RunCommandRequest # type: ignore - from ._models import RunCommandResult # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileAzureDefender +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_container_service_client_enums.py index 0aa1a761f144..da540000be1b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools @@ -39,7 +24,7 @@ class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: User agent pools are primarily for hosting your application pods. USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of Agent Pool. """ @@ -48,7 +33,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use of this is strongly discouraged. AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ @@ -57,7 +42,7 @@ class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The cluster is stopped. STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -66,7 +51,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice of orchestrator. """ @@ -74,7 +59,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. Note: This is no longer maintained. """ @@ -253,7 +238,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -262,7 +247,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -271,7 +256,7 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'random'. See `expanders `_ for more information. @@ -294,13 +279,13 @@ class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Used when you don't have a particular need for the node groups to scale differently. RANDOM = "random" -class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of extendedLocation. """ EDGE_ZONE = "EdgeZone" -class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. """ @@ -310,7 +295,7 @@ class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIG4_G = "MIG4g" MIG7_G = "MIG7g" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. """ @@ -320,7 +305,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Kubelet will use the temporary disk for its data. TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. """ @@ -330,7 +315,7 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Enables Azure Hybrid User Benefits for Windows VMs. WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. @@ -343,7 +328,7 @@ class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use a basic Load Balancer with limited functionality. BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -352,13 +337,13 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'Free'. See `uptime SLA `_ for more details. """ @@ -369,7 +354,7 @@ class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This cannot be specified if networkPlugin is anything other than 'azure'. """ @@ -380,7 +365,7 @@ class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: This is no longer supported. BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building the Kubernetes network. """ @@ -393,7 +378,7 @@ class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: information. KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building the Kubernetes network. """ @@ -406,7 +391,7 @@ class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: for more information. AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS @@ -422,14 +407,14 @@ class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: provides lower read/write latency, along with faster node scaling and cluster upgrades. EPHEMERAL = "Ephemeral" -class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies an OS SKU. This value must not be specified if OSType is Windows. """ UBUNTU = "Ubuntu" CBL_MARINER = "CBLMariner" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The operating system type. The default is Linux. """ @@ -438,7 +423,7 @@ class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use Windows. WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This can only be set at cluster creation time and cannot be changed later. For more information see `egress outbound type `_. """ @@ -458,7 +443,7 @@ class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: advanced scenario and requires proper network configuration. USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -467,7 +452,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `use managed identities in AKS `_. """ @@ -483,7 +468,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. NONE = "None" -class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleDownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes how VMs are added to or removed from Agent Pools. See `billing states `_. """ @@ -494,7 +479,7 @@ class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: during scale down. DEALLOCATE = "Deallocate" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see `spot VMs `_ @@ -507,7 +492,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: cause issues with cluster scaling or upgrading. DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Virtual Machine Scale Set priority. """ @@ -517,7 +502,7 @@ class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Regular VMs will be used. REGULAR = "Regular" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `setting the AKS cluster auto-upgrade channel `_. """ @@ -547,7 +532,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models.py deleted file mode 100644 index 3bab92669398..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models.py +++ /dev/null @@ -1,3678 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the agent pool version list. - :vartype id: str - :ivar name: The name of the agent pool version list. - :vartype name: str - :ivar type: Type of the agent pool version list. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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 ID of the agent pool upgrade profile. - :vartype id: str - :ivar name: The name of the agent pool upgrade profile. - :vartype name: str - :ivar type: The type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). - If a percentage is specified, it is the percentage of the total agent pool size at the time of - the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is - 1. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_07_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_07_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. - Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type - `_. Possible values include: - "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default - value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs - `_ for more information about the - differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterNATGatewayProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - self.nat_gateway_profile = kwargs.get('nat_gateway_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. A maximum of 1 key may be specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_07_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class EndpointDependency(msrest.serialization.Model): - """A domain name that AKS agent nodes are reaching at. - - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDependency, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class EndpointDetail(msrest.serialization.Model): - """connect information from the AKS agent nodes to a single endpoint. - - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDetail, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - self.port = kwargs.get('port', None) - self.protocol = kwargs.get('protocol', None) - self.description = kwargs.get('description', None) - - -class ExtendedLocation(msrest.serialization.Model): - """The complex type of the extended location. - - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocationTypes - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtendedLocation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class KubeletConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies - `_ - for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal - numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported - units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is - 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default - is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager - `_. The default is - 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_07_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The - default is 'always'. For more information see `Transparent Hugepages - `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', - 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent - Hugepages - `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """See `planned maintenance `_ for more information about planned maintenance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_07_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied - configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions - cannot be skipped. All upgrades must be performed sequentially by major version number. For - example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> - 1.16.x is not allowed. See `upgrading an AKS cluster - `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str - :ivar fqdn: The FQDN of the master pool. - :vartype fqdn: str - :ivar private_fqdn: The FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) - headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. - This special FQDN supports CORS, allowing the Azure Portal to function properly. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity - `_ for more details on AAD pod - identity integration. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for - this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details - see `disable local accounts - `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSecurityProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'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': 'ManagedClusterSKU'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - self.security_profile = kwargs.get('security_profile', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """For more details see `managed AAD on AKS `_. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """Details about a user assigned identity. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. - This feature is not compatible with clusters that use Public IP Per Node, or clusters that are - using a Basic Load Balancer. For more information see `API server authorized IP ranges - `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster - `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private - cluster or not. - :type enable_private_cluster_public_fqdn: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel - `_. Possible - values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_07_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): - """Cluster HTTP proxy configuration. - - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str - """ - - _attribute_map = { - 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, - 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, - 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, - 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) - self.http_proxy = kwargs.get('http_proxy', None) - self.https_proxy = kwargs.get('https_proxy', None) - self.no_proxy = kwargs.get('no_proxy', None) - self.trusted_ca = kwargs.get('trusted_ca', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS - `_. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed - values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in - Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): - """Profile of the managed outbound IP resources of the managed cluster. - - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must - be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 16, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterNATGatewayProfile(msrest.serialization.Model): - """Profile of the managed cluster NAT gateway. - - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster - NAT gateway. - :type managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) - self.managed_outbound_ip_profile = kwargs.get('managed_outbound_ip_profile', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 4) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """Details about the pod identity assigned to the Managed Cluster. - - Variables are only 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 name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.binding_selector = kwargs.get('binding_selector', None) - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """See `use AAD pod identity `_ for more details on pod identity integration. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the - security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet - network plugin with AAD Pod Identity - `_ - for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: - list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders - `_ - for more information. Possible values include: "least-waste", "most-pods", "priority", - "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_07_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to - act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore - unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer - followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by - an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an - integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed - by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterSecurityProfile(msrest.serialization.Model): - """Security profile for the container service cluster. - - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSecurityProfileAzureDefender - """ - - _attribute_map = { - 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfile, self).__init__(**kwargs) - self.azure_defender = kwargs.get('azure_defender', None) - - -class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): - """Azure Defender settings for the security profile. - - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be - associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.log_analytics_workspace_resource_id = kwargs.get('log_analytics_workspace_resource_id', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """The SKU of a Managed Cluster. - - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA - `_ for more details. Possible values include: - "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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 ID of the upgrade profile. - :vartype id: str - :ivar name: The name of the upgrade profile. - :vartype name: str - :ivar type: The type of the upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Possible values - include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo - `_. - :type enable_csi_proxy: bool - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class OperationListResult(msrest.serialization.Model): - """The List Operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_07_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the operation. - :vartype origin: str - :ivar name: The name of the operation. - :vartype name: str - :ivar operation: The display name of the operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSOptionProfile(msrest.serialization.Model): - """The OS option profile. - - Variables are only 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 ID of the OS option resource. - :vartype id: str - :ivar name: The name of the OS option resource. - :vartype name: str - :ivar type: The type of the OS option resource. - :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: - list[~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProperty] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.os_option_property_list = kwargs['os_option_property_list'] - - -class OSOptionProperty(msrest.serialization.Model): - """OS option property. - - All required parameters must be populated in order to send to Azure. - - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool - """ - - _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, - } - - _attribute_map = { - 'os_type': {'key': 'os-type', 'type': 'str'}, - 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProperty, self).__init__(**kwargs) - self.os_type = kwargs['os_type'] - self.enable_fips_image = kwargs['enable_fips_image'] - - -class OutboundEnvironmentEndpoint(msrest.serialization.Model): - """Egress endpoints which AKS agent nodes connect to for common purpose. - - :param category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDependency] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): - """Collection of OutboundEnvironmentEndpoint. - - Variables are only 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 value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_07_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource ID of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_07_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class RunCommandRequest(msrest.serialization.Model): - """A run command request. - - All required parameters must be populated in order to send to Azure. - - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str - """ - - _validation = { - 'command': {'required': True}, - } - - _attribute_map = { - 'command': {'key': 'command', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandRequest, self).__init__(**kwargs) - self.command = kwargs['command'] - self.context = kwargs.get('context', None) - self.cluster_token = kwargs.get('cluster_token', None) - - -class RunCommandResult(msrest.serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: The exit code of the command. - :vartype exit_code: int - :ivar started_at: The time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: The time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: The command output. - :vartype logs: str - :ivar reason: An explanation of why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'exit_code': {'readonly': True}, - 'started_at': {'readonly': True}, - 'finished_at': {'readonly': True}, - 'logs': {'readonly': True}, - 'reason': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, - 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, - 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, - 'logs': {'key': 'properties.logs', 'type': 'str'}, - 'reason': {'key': 'properties.reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandResult, self).__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_07_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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.containerservice.v2021_07_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_07_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour - ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 - UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py index da9735f90647..6f998aaa0c09 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,131 +64,132 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode + :ivar type_properties_type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile """ @@ -282,6 +285,131 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode + :keyword type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -333,8 +461,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool version list. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -357,6 +485,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -367,12 +500,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -389,6 +522,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -400,8 +541,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -421,6 +562,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -439,16 +584,16 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str """ _validation = { @@ -478,6 +623,18 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: The latest AKS supported node image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -491,10 +648,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -509,6 +666,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -517,12 +680,12 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -535,6 +698,14 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -542,17 +713,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_07_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_07_01.models.CloudErrorBody] """ _attribute_map = { @@ -571,6 +742,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_07_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -583,8 +767,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceVMDiagnostics """ @@ -602,6 +786,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -611,10 +800,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -634,6 +823,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -646,12 +842,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_07_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_07_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -689,21 +885,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -732,13 +928,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_07_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -753,41 +1010,42 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building the Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building the Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPolicy + :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type + :vartype docker_bridge_cidr: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type `_. Possible values include: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OutboundType + :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_07_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterNATGatewayProfile """ @@ -828,6 +1086,45 @@ def __init__( nat_gateway_profile: Optional["ManagedClusterNATGatewayProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building the Kubernetes network. Possible + values include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building the Kubernetes network. Possible + values include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkPolicy + :keyword network_mode: This cannot be specified if networkPlugin is anything other than + 'azure'. Possible values include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OutboundType + :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_07_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterNATGatewayProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -847,9 +1144,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshPublicKey] """ @@ -867,6 +1164,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. A maximum of 1 key may be specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -876,9 +1179,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -895,6 +1198,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -906,8 +1214,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -928,6 +1236,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -958,6 +1270,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -984,6 +1298,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -991,10 +1307,10 @@ def __init__( class EndpointDependency(msrest.serialization.Model): """A domain name that AKS agent nodes are reaching at. - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDetail] + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDetail] """ _attribute_map = { @@ -1009,6 +1325,13 @@ def __init__( endpoint_details: Optional[List["EndpointDetail"]] = None, **kwargs ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDetail] + """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name self.endpoint_details = endpoint_details @@ -1017,14 +1340,14 @@ def __init__( class EndpointDetail(msrest.serialization.Model): """connect information from the AKS agent nodes to a single endpoint. - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str """ _attribute_map = { @@ -1043,6 +1366,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ super(EndpointDetail, self).__init__(**kwargs) self.ip_address = ip_address self.port = port @@ -1053,10 +1386,10 @@ def __init__( class ExtendedLocation(msrest.serialization.Model): """The complex type of the extended location. - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocationTypes + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1071,6 +1404,12 @@ def __init__( type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocationTypes + """ super(ExtendedLocation, self).__init__(**kwargs) self.name = name self.type = type @@ -1079,40 +1418,40 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies `_ for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager `_. The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1149,6 +1488,42 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1166,19 +1541,19 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_07_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_07_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1197,6 +1572,21 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_07_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1218,11 +1608,11 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system metadata relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_07_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied + :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeSpan] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeSpan] """ _validation = { @@ -1248,6 +1638,13 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_07_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1259,8 +1656,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1280,6 +1677,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1298,10 +1700,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1326,6 +1728,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1347,32 +1755,32 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str + :vartype kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str :ivar fqdn: The FQDN of the master pool. :vartype fqdn: str :ivar private_fqdn: The FQDN of private cluster. @@ -1381,68 +1789,68 @@ class ManagedCluster(Resource): headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity + :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. - :type pod_identity_profile: + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: + :ivar disk_encryption_set_id: This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSecurityProfile """ @@ -1532,6 +1940,93 @@ def __init__( security_profile: Optional["ManagedClusterSecurityProfile"] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSecurityProfile + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.extended_location = extended_location @@ -1570,22 +2065,22 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """For more details see `managed AAD on AKS `_. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1610,6 +2105,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1633,12 +2146,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1665,6 +2178,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1676,10 +2197,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAddonProfileIdentity @@ -1703,6 +2224,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1712,12 +2239,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """Details about a user assigned identity. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1734,6 +2261,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1743,12 +2278,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1765,6 +2300,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1773,130 +2316,131 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile """ @@ -1986,6 +2530,130 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2033,133 +2701,134 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_07_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str + :ivar name: Required. Windows agent pool names must be 6 characters or less. + :vartype name: str """ _validation = { @@ -2251,6 +2920,132 @@ def __init__( gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.KubeletDiskType + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_07_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_07_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_07_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_07_01.models.GPUInstanceProfile + :keyword name: Required. Windows agent pool names must be 6 characters or less. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, **kwargs) self.name = name @@ -2258,21 +3053,21 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see `API server authorized IP ranges `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private cluster or not. - :type enable_private_cluster_public_fqdn: bool + :vartype enable_private_cluster_public_fqdn: bool """ _attribute_map = { @@ -2291,6 +3086,23 @@ def __init__( enable_private_cluster_public_fqdn: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :paramtype enable_private_cluster_public_fqdn: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2301,10 +3113,10 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. Possible values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_07_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_07_01.models.UpgradeChannel """ _attribute_map = { @@ -2317,6 +3129,13 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Possible values include: "rapid", "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_07_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2324,14 +3143,14 @@ def __init__( class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): """Cluster HTTP proxy configuration. - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str """ _attribute_map = { @@ -2350,6 +3169,16 @@ def __init__( trusted_ca: Optional[str] = None, **kwargs ): + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) self.http_proxy = http_proxy self.https_proxy = https_proxy @@ -2368,13 +3197,13 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS + :ivar type: For more information see `use managed identities in AKS `_. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: + :vartype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_07_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ @@ -2397,6 +3226,16 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2409,8 +3248,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2430,6 +3269,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2438,27 +3281,26 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2486,6 +3328,29 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 30, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] + :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2498,9 +3363,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + :ivar count: The desired number of outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2517,6 +3382,12 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2524,8 +3395,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] """ @@ -2539,6 +3410,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2546,8 +3422,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] """ _attribute_map = { @@ -2560,6 +3436,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2567,9 +3447,9 @@ def __init__( class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): """Profile of the managed outbound IP resources of the managed cluster. - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2586,6 +3466,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) self.count = count @@ -2593,16 +3478,16 @@ def __init__( class ManagedClusterNATGatewayProfile(msrest.serialization.Model): """Profile of the managed cluster NAT gateway. - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. - :type managed_outbound_ip_profile: + :vartype managed_outbound_ip_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2623,6 +3508,19 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 4, **kwargs ): + """ + :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the + cluster NAT gateway. + :paramtype managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_07_01.models.ResourceReference] + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) self.managed_outbound_ip_profile = managed_outbound_ip_profile self.effective_outbound_i_ps = effective_outbound_i_ps @@ -2636,14 +3534,14 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity + :ivar name: Required. The name of the pod identity. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. The user assigned identity details. + :vartype identity: ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2679,6 +3577,16 @@ def __init__( binding_selector: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The name of the pod identity. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. The user assigned identity details. + :paramtype identity: ~azure.mgmt.containerservice.v2021_07_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2693,12 +3601,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. The name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. The pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2721,6 +3629,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. The name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. The pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2730,19 +3646,19 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """See `use AAD pod identity `_ for more details on pod identity integration. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity `_ for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: The pod identities to use in the cluster. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityException] """ @@ -2762,6 +3678,22 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: The pod identities to use in the cluster. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2772,8 +3704,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param error: Details about the error. - :type error: + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ @@ -2787,6 +3719,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) self.error = error @@ -2794,17 +3731,17 @@ def __init__( class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ @@ -2824,6 +3761,20 @@ def __init__( details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -2834,8 +3785,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningError """ @@ -2849,6 +3800,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPodIdentityProvisioningError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2858,15 +3814,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :vartype name: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2891,6 +3847,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :paramtype name: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2901,10 +3869,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2919,6 +3887,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -2927,53 +3901,52 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar expander: If not specified, the default is 'random'. See `expanders `_ for more information. Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_07_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + :vartype expander: str or ~azure.mgmt.containerservice.v2021_07_01.models.Expander + :ivar max_empty_bulk_delete: The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -3018,6 +3991,55 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_07_01.models.Expander + :keyword max_empty_bulk_delete: The default is 10. + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: The default is 600. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -3041,8 +4063,8 @@ def __init__( class ManagedClusterSecurityProfile(msrest.serialization.Model): """Security profile for the container service cluster. - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: + :ivar azure_defender: Azure Defender settings for the security profile. + :vartype azure_defender: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSecurityProfileAzureDefender """ @@ -3056,6 +4078,11 @@ def __init__( azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, **kwargs ): + """ + :keyword azure_defender: Azure Defender settings for the security profile. + :paramtype azure_defender: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSecurityProfileAzureDefender + """ super(ManagedClusterSecurityProfile, self).__init__(**kwargs) self.azure_defender = azure_defender @@ -3063,12 +4090,13 @@ def __init__( class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): """Azure Defender settings for the security profile. - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + :ivar enabled: Whether to enable Azure Defender. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :vartype log_analytics_workspace_resource_id: str """ _attribute_map = { @@ -3083,6 +4111,15 @@ def __init__( log_analytics_workspace_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword enabled: Whether to enable Azure Defender. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :paramtype log_analytics_workspace_resource_id: str + """ super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) self.enabled = enabled self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id @@ -3093,10 +4130,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -3115,6 +4152,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -3123,12 +4166,12 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """The SKU of a Managed Cluster. - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA + :ivar name: The name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA `_ for more details. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUTier + :vartype tier: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -3143,6 +4186,14 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: The name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -3161,12 +4212,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3193,6 +4244,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3206,29 +4266,29 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + :vartype admin_password: str + :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.LicenseType + :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. - :type enable_csi_proxy: bool + :vartype enable_csi_proxy: bool """ _validation = { @@ -3251,6 +4311,31 @@ def __init__( enable_csi_proxy: Optional[bool] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.LicenseType + :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :paramtype enable_csi_proxy: bool + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3283,6 +4368,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -3309,6 +4396,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3354,6 +4443,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3376,8 +4467,8 @@ class OSOptionProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the OS option resource. :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: + :ivar os_option_property_list: Required. The list of OS options. + :vartype os_option_property_list: list[~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProperty] """ @@ -3401,6 +4492,11 @@ def __init__( os_option_property_list: List["OSOptionProperty"], **kwargs ): + """ + :keyword os_option_property_list: Required. The list of OS options. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProperty] + """ super(OSOptionProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3413,10 +4509,10 @@ class OSOptionProperty(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool + :ivar os_type: Required. The OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether the image is FIPS-enabled. + :vartype enable_fips_image: bool """ _validation = { @@ -3436,6 +4532,12 @@ def __init__( enable_fips_image: bool, **kwargs ): + """ + :keyword os_type: Required. The OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether the image is FIPS-enabled. + :paramtype enable_fips_image: bool + """ super(OSOptionProperty, self).__init__(**kwargs) self.os_type = os_type self.enable_fips_image = enable_fips_image @@ -3444,11 +4546,11 @@ def __init__( class OutboundEnvironmentEndpoint(msrest.serialization.Model): """Egress endpoints which AKS agent nodes connect to for common purpose. - :param category: The category of endpoints accessed by the AKS agent node, e.g. + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDependency] + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDependency] """ _attribute_map = { @@ -3463,6 +4565,13 @@ def __init__( endpoints: Optional[List["EndpointDependency"]] = None, **kwargs ): + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: list[~azure.mgmt.containerservice.v2021_07_01.models.EndpointDependency] + """ super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) self.category = category self.endpoints = endpoints @@ -3475,8 +4584,9 @@ class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpoint] + :ivar value: Required. Collection of resources. + :vartype value: + list[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3497,6 +4607,11 @@ def __init__( value: List["OutboundEnvironmentEndpoint"], **kwargs ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpoint] + """ super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) self.value = value self.next_link = None @@ -3505,9 +4620,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_07_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_07_01.models.Code """ _attribute_map = { @@ -3520,6 +4635,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_07_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3527,8 +4647,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource ID of the private endpoint. - :type id: str + :ivar id: The resource ID of the private endpoint. + :vartype id: str """ _attribute_map = { @@ -3541,6 +4661,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3560,11 +4684,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkServiceConnectionState """ @@ -3591,6 +4715,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3603,8 +4735,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3617,6 +4749,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3626,16 +4763,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3664,6 +4801,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3676,8 +4825,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3690,6 +4839,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3697,11 +4850,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_07_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_07_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3716,6 +4869,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_07_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3724,8 +4884,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3738,6 +4898,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3747,12 +4911,12 @@ class RunCommandRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str + :ivar command: Required. The command to run. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str """ _validation = { @@ -3773,6 +4937,14 @@ def __init__( cluster_token: Optional[str] = None, **kwargs ): + """ + :keyword command: Required. The command to run. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ super(RunCommandRequest, self).__init__(**kwargs) self.command = command self.context = context @@ -3824,6 +4996,8 @@ def __init__( self, **kwargs ): + """ + """ super(RunCommandResult, self).__init__(**kwargs) self.id = None self.provisioning_state = None @@ -3837,62 +5011,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -3959,6 +5133,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -3993,21 +5225,21 @@ def __init__( 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.containerservice.v2021_07_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.CreatedByType + :ivar created_at: The UTC timestamp of resource creation. + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_07_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -4030,6 +5262,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.CreatedByType + :keyword created_at: The UTC timestamp of resource creation. + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_07_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -4042,8 +5292,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -4056,6 +5306,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -4063,13 +5317,13 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_07_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + :vartype day: str or ~azure.mgmt.containerservice.v2021_07_01.models.WeekDay + :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] + :vartype hour_slots: list[int] """ _attribute_map = { @@ -4084,6 +5338,15 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_07_01.models.WeekDay + :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -4092,10 +5355,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -4110,6 +5373,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py index 608f1f9fe7ca..4b79fefb7cea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. @@ -64,7 +331,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -72,36 +340,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,19 +384,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the specified managed cluster agent pool. Gets the specified managed cluster agent pool. @@ -152,28 +418,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,49 +443,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -247,17 +494,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool in the specified managed cluster. Creates or updates an agent pool in the specified managed cluster. @@ -272,15 +521,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -293,28 +546,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -326,43 +572,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -375,14 +611,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool in the specified managed cluster. Deletes an agent pool in the specified managed cluster. @@ -395,15 +632,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -418,22 +657,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -445,16 +676,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets the upgrade profile for an agent pool. Gets the upgrade profile for an agent pool. @@ -475,28 +707,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,15 +732,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported Kubernetes versions for the specified agent pool. See `supported Kubernetes versions @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrades the node image version of an agent pool to the latest. Upgrading the node image version of an agent pool applies the newest OS and runtime updates to @@ -649,15 +856,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -672,25 +882,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,4 +904,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py index 3299a7c82061..3ba12299eed2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -61,8 +219,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -70,36 +230,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,19 +274,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the specified maintenance configuration of a managed cluster. Gets the specified maintenance configuration of a managed cluster. @@ -150,28 +308,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,17 +333,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configuration in the specified managed cluster. Creates or updates a maintenance configuration in the specified managed cluster. @@ -218,33 +368,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -258,16 +398,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes a maintenance configuration. @@ -288,28 +430,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,3 +453,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py index 2cb300f06452..277a2101ddb6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py @@ -5,25 +5,785 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,13 +807,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_os_options( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OSOptionProfile" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": """Gets supported OS options in the specified subscription. Gets supported OS options in the specified subscription. @@ -72,28 +832,17 @@ def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -107,20 +856,24 @@ def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -128,34 +881,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -173,17 +921,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. @@ -191,8 +940,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -200,35 +951,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -246,18 +993,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets the upgrade profile of a managed cluster. Gets the upgrade profile of a managed cluster. @@ -276,27 +1024,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,16 +1048,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials @@ -343,28 +1083,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,16 +1108,18 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the admin credentials of a managed cluster. Lists the admin credentials of a managed cluster. @@ -408,29 +1140,18 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -444,16 +1165,18 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the user credentials of a managed cluster. Lists the user credentials of a managed cluster. @@ -474,29 +1197,18 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,16 +1222,18 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the cluster monitoring user credentials of a managed cluster. Lists the cluster monitoring user credentials of a managed cluster. @@ -540,29 +1254,18 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -576,15 +1279,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets a managed cluster. @@ -603,27 +1308,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -637,47 +1332,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -695,16 +1381,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster. @@ -717,15 +1405,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -737,27 +1430,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -769,47 +1456,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -823,16 +1500,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates tags on a managed cluster. @@ -845,15 +1524,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -865,27 +1549,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -897,41 +1575,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -944,13 +1612,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes a managed cluster. @@ -961,15 +1630,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -983,21 +1654,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1009,47 +1673,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1062,14 +1716,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the Service Principal Profile of a managed cluster. This action cannot be performed on a cluster that is not using a service principal. @@ -1079,18 +1734,22 @@ def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1102,24 +1761,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1131,47 +1784,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1184,14 +1827,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. Reset the AAD Profile of a managed cluster. @@ -1204,15 +1848,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1224,24 +1871,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1253,41 +1894,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1300,13 +1931,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotates the certificates of a managed cluster. See `Certificate rotation `_ for @@ -1318,15 +1950,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1340,21 +1974,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,41 +1993,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1413,13 +2030,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stops a Managed Cluster. This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a @@ -1434,15 +2052,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1456,21 +2076,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,41 +2095,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1529,13 +2132,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Starts a previously stopped Managed Cluster. See `starting a cluster `_ for more @@ -1547,15 +2151,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1569,21 +2175,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1595,47 +2194,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore def _run_command_initial( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1651,16 +2240,18 @@ def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace def begin_run_command( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: """Submits a command to run against the Managed Cluster. AKS will create a pod to run the command. This is primarily useful for private clusters. For @@ -1675,15 +2266,20 @@ def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_07_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1695,27 +2291,21 @@ def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1727,16 +2317,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace def get_command_result( self, - resource_group_name, # type: str - resource_name, # type: str - command_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: """Gets the results of a command which has been run on the Managed Cluster. Gets the results of a command which has been run on the Managed Cluster. @@ -1757,28 +2348,18 @@ def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1794,16 +2375,19 @@ def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1813,8 +2397,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1822,36 +2408,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1869,6 +2452,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py index 000327841653..bfa761293fb3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,18 +72,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of operations. Gets a list of operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -64,30 +92,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,6 +130,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py index 2f4f8abff564..61745a76ff43 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. To learn more about private clusters, see: @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection. To learn more about private clusters, see: @@ -137,28 +287,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -172,17 +312,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection. @@ -205,33 +347,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -245,43 +377,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,14 +417,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes a private endpoint connection. @@ -314,15 +438,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -337,22 +463,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -364,4 +482,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py index 4b0e3b6c04b7..93b00c66e3f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. To learn more about private clusters, see: @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py index 88129d99ad06..fcf91fb19ad8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID for the specified managed cluster. @@ -72,32 +119,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -111,4 +148,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py index 36777d882373..c5d82134f92b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py index 5827c29f4681..b531aa9cec42 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py @@ -6,109 +6,105 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .operations import SnapshotsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_08_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_08_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_08_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_08_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_08_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_08_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_08_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_08_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_08_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_08_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_08_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_08_01.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.v2021_08_01.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json index cc02a82d3151..ea33bc2ba9f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py index b848bd081877..47c22caba3df 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py index c160224555c8..83098df5c56b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py @@ -6,105 +6,106 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .operations import SnapshotsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_08_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_08_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_08_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_08_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_08_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_08_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_08_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_08_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_08_01.aio.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.v2021_08_01.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py index 35246f92999e..ff16e9644b5c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -59,7 +65,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -67,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -114,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -181,8 +177,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -196,33 +194,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -240,8 +228,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -264,15 +255,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -285,28 +281,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -318,6 +307,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -332,28 +322,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -366,6 +346,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -385,15 +367,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -408,22 +392,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -435,8 +411,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -464,28 +442,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +467,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -635,15 +591,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -658,25 +618,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -688,4 +640,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py index 665aa8a3b8cd..d315c7b6e72d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -56,8 +62,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -65,36 +73,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -144,28 +151,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -179,8 +176,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -211,33 +211,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -251,8 +241,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -280,28 +273,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,3 +296,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py index 9a7cbf8d7f64..f67fea56299b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_outbound_network_dependencies_endpoints_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get_os_options( self, location: str, @@ -67,28 +73,17 @@ async def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -102,8 +97,11 @@ async def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -113,8 +111,10 @@ def list( Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -122,34 +122,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -167,11 +162,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -184,8 +181,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -193,35 +192,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -239,11 +234,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -268,27 +265,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -302,8 +289,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -334,28 +324,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +349,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -398,29 +381,18 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -434,8 +406,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -463,29 +438,18 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +463,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -528,29 +495,18 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -564,8 +520,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -590,27 +549,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -624,8 +573,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -638,32 +589,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -681,8 +622,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -702,15 +646,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -722,27 +671,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -754,6 +697,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -768,32 +712,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -807,8 +741,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -828,15 +765,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -848,27 +790,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -880,6 +816,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -893,27 +830,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -926,6 +853,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -942,15 +871,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -964,21 +895,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -990,6 +914,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -1004,32 +929,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1042,6 +957,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -1058,18 +975,22 @@ async def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1081,24 +1002,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1110,6 +1025,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1124,32 +1040,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1162,6 +1068,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1181,15 +1089,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1201,24 +1112,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1230,6 +1135,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1243,27 +1149,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1276,6 +1172,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1293,15 +1191,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1315,21 +1215,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,6 +1234,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1354,27 +1248,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1387,6 +1271,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1407,15 +1293,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1429,21 +1317,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1455,6 +1336,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1468,27 +1350,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1501,6 +1373,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1518,15 +1392,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1540,21 +1416,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,6 +1435,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore async def _run_command_initial( @@ -1580,32 +1450,22 @@ async def _run_command_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1621,8 +1481,11 @@ async def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async async def begin_run_command( self, resource_group_name: str, @@ -1644,15 +1507,20 @@ async def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1664,27 +1532,21 @@ async def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1696,8 +1558,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace_async async def get_command_result( self, resource_group_name: str, @@ -1725,28 +1589,18 @@ async def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1762,15 +1616,19 @@ async def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1780,8 +1638,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1789,36 +1649,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1836,6 +1693,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py index 0d3ad21a22b0..d0bd9e4a4692 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -59,30 +66,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -100,6 +104,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py index db60eeac5c58..84df865d56aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -131,28 +129,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -166,8 +154,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -198,33 +189,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -238,8 +219,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -252,28 +235,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -286,6 +259,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -305,15 +280,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -328,22 +305,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -355,4 +324,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py index 7a5893b6c4aa..9e1b8d19b1e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py index 848874421313..7ea0128edfd2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -67,32 +72,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -106,4 +101,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py index 164d57e3b7bf..86aa1e4ba85b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._snapshots_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -59,34 +66,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +106,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -122,7 +126,8 @@ def list_by_resource_group( :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 SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -130,35 +135,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -176,11 +177,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -205,27 +208,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -239,8 +232,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -268,32 +264,22 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Snapshot') - 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 @@ -311,8 +297,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def update_tags( self, resource_group_name: str, @@ -340,32 +329,22 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -379,8 +358,11 @@ async def update_tags( return cls(pipeline_response, deserialized, {}) return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -405,27 +387,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -437,3 +409,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py index ae984aa96041..db5980a4e09a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py @@ -6,178 +6,92 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CreationData - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import EndpointDependency - from ._models_py3 import EndpointDetail - from ._models_py3 import ExtendedLocation - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterHTTPProxyConfig - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterManagedOutboundIPProfile - from ._models_py3 import ManagedClusterNATGatewayProfile - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningError - from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterSecurityProfile - from ._models_py3 import ManagedClusterSecurityProfileAzureDefender - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue - from ._models_py3 import OSOptionProfile - from ._models_py3 import OSOptionProperty - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OutboundEnvironmentEndpoint - from ._models_py3 import OutboundEnvironmentEndpointCollection - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import RunCommandRequest - from ._models_py3 import RunCommandResult - from ._models_py3 import Snapshot - from ._models_py3 import SnapshotListResult - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CreationData # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import EndpointDependency # type: ignore - from ._models import EndpointDetail # type: ignore - from ._models import ExtendedLocation # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterHTTPProxyConfig # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterManagedOutboundIPProfile # type: ignore - from ._models import ManagedClusterNATGatewayProfile # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterSecurityProfile # type: ignore - from ._models import ManagedClusterSecurityProfileAzureDefender # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import OSOptionProfile # type: ignore - from ._models import OSOptionProperty # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OutboundEnvironmentEndpoint # type: ignore - from ._models import OutboundEnvironmentEndpointCollection # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import RunCommandRequest # type: ignore - from ._models import RunCommandResult # type: ignore - from ._models import Snapshot # type: ignore - from ._models import SnapshotListResult # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileAzureDefender +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py index 9eeb9d5f0677..54490bab6467 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools @@ -39,7 +24,7 @@ class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: User agent pools are primarily for hosting your application pods. USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of Agent Pool. """ @@ -48,7 +33,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use of this is strongly discouraged. AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ @@ -57,7 +42,7 @@ class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The cluster is stopped. STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -66,7 +51,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice of orchestrator. """ @@ -74,7 +59,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. Note: This is no longer maintained. """ @@ -253,7 +238,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -262,7 +247,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -271,7 +256,7 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'random'. See `expanders `_ for more information. @@ -294,13 +279,13 @@ class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Used when you don't have a particular need for the node groups to scale differently. RANDOM = "random" -class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of extendedLocation. """ EDGE_ZONE = "EdgeZone" -class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. """ @@ -310,7 +295,7 @@ class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIG4_G = "MIG4g" MIG7_G = "MIG7g" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. """ @@ -320,7 +305,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Kubelet will use the temporary disk for its data. TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. """ @@ -330,7 +315,7 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Enables Azure Hybrid User Benefits for Windows VMs. WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. @@ -343,7 +328,7 @@ class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use a basic Load Balancer with limited functionality. BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -352,13 +337,13 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'Free'. See `uptime SLA `_ for more details. """ @@ -369,7 +354,7 @@ class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This cannot be specified if networkPlugin is anything other than 'azure'. """ @@ -380,7 +365,7 @@ class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: This is no longer supported. BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building the Kubernetes network. """ @@ -393,7 +378,7 @@ class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: information. KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building the Kubernetes network. """ @@ -406,7 +391,7 @@ class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: for more information. AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS @@ -422,14 +407,14 @@ class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: provides lower read/write latency, along with faster node scaling and cluster upgrades. EPHEMERAL = "Ephemeral" -class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies an OS SKU. This value must not be specified if OSType is Windows. """ UBUNTU = "Ubuntu" CBL_MARINER = "CBLMariner" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The operating system type. The default is Linux. """ @@ -438,7 +423,7 @@ class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use Windows. WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This can only be set at cluster creation time and cannot be changed later. For more information see `egress outbound type `_. """ @@ -458,7 +443,7 @@ class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: advanced scenario and requires proper network configuration. USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -467,7 +452,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PublicNetworkAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster """ @@ -475,7 +460,7 @@ class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ENABLED = "Enabled" DISABLED = "Disabled" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `use managed identities in AKS `_. """ @@ -491,7 +476,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. NONE = "None" -class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleDownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes how VMs are added to or removed from Agent Pools. See `billing states `_. """ @@ -502,7 +487,7 @@ class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: during scale down. DEALLOCATE = "Deallocate" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see `spot VMs `_ @@ -515,7 +500,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: cause issues with cluster scaling or upgrading. DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Virtual Machine Scale Set priority. """ @@ -525,14 +510,14 @@ class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Regular VMs will be used. REGULAR = "Regular" -class SnapshotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SnapshotType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of a snapshot. The default is NodePool. """ #: The snapshot is a snapshot of a node pool. NODE_POOL = "NodePool" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `setting the AKS cluster auto-upgrade channel `_. """ @@ -562,7 +547,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ @@ -574,7 +559,7 @@ class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class WorkloadRuntime(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WorkloadRuntime(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the type of workload a node can run. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py deleted file mode 100644 index dcc69103dd79..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py +++ /dev/null @@ -1,3826 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Desired Number of agents (VMs) specified to host docker containers. Allowed - values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to - 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.workload_runtime = kwargs.get('workload_runtime', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - self.creation_data = kwargs.get('creation_data', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the agent pool version list. - :vartype id: str - :ivar name: The name of the agent pool version list. - :vartype name: str - :ivar type: Type of the agent pool version list. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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 ID of the agent pool upgrade profile. - :vartype id: str - :ivar name: The name of the agent pool upgrade profile. - :vartype name: str - :ivar type: The type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). - If a percentage is specified, it is the percentage of the total agent pool size at the time of - the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is - 1. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_08_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. - Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type - `_. Possible values include: - "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default - value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs - `_ for more information about the - differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - self.nat_gateway_profile = kwargs.get('nat_gateway_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. A maximum of 1 key may be specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CreationData(msrest.serialization.Model): - """Data used when creating a target resource from a source resource. - - :param source_resource_id: This is the ARM ID of the source object to be used to create the - target object. - :type source_resource_id: str - """ - - _attribute_map = { - 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreationData, self).__init__(**kwargs) - self.source_resource_id = kwargs.get('source_resource_id', None) - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_08_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class EndpointDependency(msrest.serialization.Model): - """A domain name that AKS agent nodes are reaching at. - - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDependency, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class EndpointDetail(msrest.serialization.Model): - """connect information from the AKS agent nodes to a single endpoint. - - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDetail, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - self.port = kwargs.get('port', None) - self.protocol = kwargs.get('protocol', None) - self.description = kwargs.get('description', None) - - -class ExtendedLocation(msrest.serialization.Model): - """The complex type of the extended location. - - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtendedLocation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class KubeletConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies - `_ - for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal - numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported - units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is - 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default - is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager - `_. The default is - 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The - default is 'always'. For more information see `Transparent Hugepages - `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', - 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent - Hugepages - `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """See `planned maintenance `_ for more information about planned maintenance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied - configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions - cannot be skipped. All upgrades must be performed sequentially by major version number. For - example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> - 1.16.x is not allowed. See `upgrading an AKS cluster - `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str - :ivar fqdn: The FQDN of the master pool. - :vartype fqdn: str - :ivar private_fqdn: The FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) - headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. - This special FQDN supports CORS, allowing the Azure Portal to function properly. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity - `_ for more details on AAD pod - identity integration. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for - this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details - see `disable local accounts - `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile - :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to - 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". - :type public_network_access: str or - ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'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': 'ManagedClusterSKU'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - self.security_profile = kwargs.get('security_profile', None) - self.public_network_access = kwargs.get('public_network_access', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """For more details see `managed AAD on AKS `_. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """Details about a user assigned identity. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Desired Number of agents (VMs) specified to host docker containers. Allowed - values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to - 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.workload_runtime = kwargs.get('workload_runtime', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = None - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - self.creation_data = kwargs.get('creation_data', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Desired Number of agents (VMs) specified to host docker containers. Allowed - values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to - 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Describes whether the Agent Pool is Running or Stopped. - :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. - This feature is not compatible with clusters that use Public IP Per Node, or clusters that are - using a Basic Load Balancer. For more information see `API server authorized IP ranges - `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster - `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private - cluster or not. - :type enable_private_cluster_public_fqdn: bool - :param disable_run_command: Whether to disable run command for the cluster or not. - :type disable_run_command: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, - 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) - self.disable_run_command = kwargs.get('disable_run_command', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel - `_. Possible - values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): - """Cluster HTTP proxy configuration. - - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str - """ - - _attribute_map = { - 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, - 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, - 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, - 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) - self.http_proxy = kwargs.get('http_proxy', None) - self.https_proxy = kwargs.get('https_proxy', None) - self.no_proxy = kwargs.get('no_proxy', None) - self.trusted_ca = kwargs.get('trusted_ca', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS - `_. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed - values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in - Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS - cluster or not. - :type enable_multiple_standard_load_balancers: bool - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - self.enable_multiple_standard_load_balancers = kwargs.get('enable_multiple_standard_load_balancers', None) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): - """Profile of the managed outbound IP resources of the managed cluster. - - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must - be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 16, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterNATGatewayProfile(msrest.serialization.Model): - """Profile of the managed cluster NAT gateway. - - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster - NAT gateway. - :type managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) - self.managed_outbound_ip_profile = kwargs.get('managed_outbound_ip_profile', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 4) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """Details about the pod identity assigned to the Managed Cluster. - - Variables are only 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 name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.binding_selector = kwargs.get('binding_selector', None) - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """See `use AAD pod identity `_ for more details on pod identity integration. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the - security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet - network plugin with AAD Pod Identity - `_ - for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: - list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders - `_ - for more information. Possible values include: "least-waste", "most-pods", "priority", - "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to - act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore - unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer - followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by - an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an - integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed - by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterSecurityProfile(msrest.serialization.Model): - """Security profile for the container service cluster. - - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender - """ - - _attribute_map = { - 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfile, self).__init__(**kwargs) - self.azure_defender = kwargs.get('azure_defender', None) - - -class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): - """Azure Defender settings for the security profile. - - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be - associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.log_analytics_workspace_resource_id = kwargs.get('log_analytics_workspace_resource_id', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """The SKU of a Managed Cluster. - - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA - `_ for more details. Possible values include: - "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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 ID of the upgrade profile. - :vartype id: str - :ivar name: The name of the upgrade profile. - :vartype name: str - :ivar type: The type of the upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Possible values - include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo - `_. - :type enable_csi_proxy: bool - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class OperationListResult(msrest.serialization.Model): - """The List Operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the operation. - :vartype origin: str - :ivar name: The name of the operation. - :vartype name: str - :ivar operation: The display name of the operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSOptionProfile(msrest.serialization.Model): - """The OS option profile. - - Variables are only 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 ID of the OS option resource. - :vartype id: str - :ivar name: The name of the OS option resource. - :vartype name: str - :ivar type: The type of the OS option resource. - :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: - list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.os_option_property_list = kwargs['os_option_property_list'] - - -class OSOptionProperty(msrest.serialization.Model): - """OS option property. - - All required parameters must be populated in order to send to Azure. - - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool - """ - - _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, - } - - _attribute_map = { - 'os_type': {'key': 'os-type', 'type': 'str'}, - 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProperty, self).__init__(**kwargs) - self.os_type = kwargs['os_type'] - self.enable_fips_image = kwargs['enable_fips_image'] - - -class OutboundEnvironmentEndpoint(msrest.serialization.Model): - """Egress endpoints which AKS agent nodes connect to for common purpose. - - :param category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): - """Collection of OutboundEnvironmentEndpoint. - - Variables are only 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 value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource ID of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class RunCommandRequest(msrest.serialization.Model): - """A run command request. - - All required parameters must be populated in order to send to Azure. - - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str - """ - - _validation = { - 'command': {'required': True}, - } - - _attribute_map = { - 'command': {'key': 'command', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandRequest, self).__init__(**kwargs) - self.command = kwargs['command'] - self.context = kwargs.get('context', None) - self.cluster_token = kwargs.get('cluster_token', None) - - -class RunCommandResult(msrest.serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: The exit code of the command. - :vartype exit_code: int - :ivar started_at: The time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: The time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: The command output. - :vartype logs: str - :ivar reason: An explanation of why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'exit_code': {'readonly': True}, - 'started_at': {'readonly': True}, - 'finished_at': {'readonly': True}, - 'logs': {'readonly': True}, - 'reason': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, - 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, - 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, - 'logs': {'key': 'properties.logs', 'type': 'str'}, - 'reason': {'key': 'properties.reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandResult, self).__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None - - -class Snapshot(Resource): - """A node pool snapshot 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. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar system_data: The system metadata relating to this snapshot. - :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData - :param creation_data: CreationData to be used to specify the source agent pool resource ID to - create this snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData - :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: - "NodePool". Default value: "NodePool". - :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'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}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, - 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Snapshot, self).__init__(**kwargs) - self.system_data = None - self.creation_data = kwargs.get('creation_data', None) - self.snapshot_type = kwargs.get('snapshot_type', "NodePool") - - -class SnapshotListResult(msrest.serialization.Model): - """The response from the List Snapshots operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of snapshots. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] - :ivar next_link: The URL to get the next set of snapshot results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Snapshot]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SnapshotListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_08_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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.containerservice.v2021_08_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour - ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 - UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py index 5b4b05b460ca..01bacec5b522 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,138 +64,140 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Desired Number of agents (VMs) specified to host docker containers. Allowed - values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to - 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :ivar count: Desired Number of agents (VMs) specified to host docker containers. Allowed values + must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 + (inclusive) for system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :ivar type_properties_type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData """ _validation = { @@ -292,6 +296,138 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Desired Number of agents (VMs) specified to host docker containers. Allowed + values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to + 1000 (inclusive) for system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :keyword type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -345,8 +481,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool version list. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -369,6 +505,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -379,12 +520,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -401,6 +542,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -412,8 +561,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -433,6 +582,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -451,16 +604,16 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str """ _validation = { @@ -490,6 +643,18 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: The latest AKS supported node image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -503,10 +668,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -521,6 +686,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -529,12 +700,12 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -547,6 +718,14 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -554,17 +733,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] """ _attribute_map = { @@ -583,6 +762,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -595,8 +787,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMDiagnostics """ @@ -614,6 +806,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -623,10 +820,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -646,6 +843,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -658,12 +862,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_08_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_08_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -701,21 +905,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -744,13 +948,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_08_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -765,41 +1030,42 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building the Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building the Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy + :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type + :vartype docker_bridge_cidr: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type `_. Possible values include: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType + :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile """ @@ -840,6 +1106,45 @@ def __init__( nat_gateway_profile: Optional["ManagedClusterNATGatewayProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building the Kubernetes network. Possible + values include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building the Kubernetes network. Possible + values include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy + :keyword network_mode: This cannot be specified if networkPlugin is anything other than + 'azure'. Possible values include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType + :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -859,9 +1164,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] """ @@ -879,6 +1184,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. A maximum of 1 key may be specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -888,9 +1199,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -907,6 +1218,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -918,8 +1234,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -940,6 +1256,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -948,9 +1268,9 @@ def __init__( class CreationData(msrest.serialization.Model): """Data used when creating a target resource from a source resource. - :param source_resource_id: This is the ARM ID of the source object to be used to create the + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the target object. - :type source_resource_id: str + :vartype source_resource_id: str """ _attribute_map = { @@ -963,6 +1283,11 @@ def __init__( source_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ super(CreationData, self).__init__(**kwargs) self.source_resource_id = source_resource_id @@ -992,6 +1317,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1018,6 +1345,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1025,10 +1354,10 @@ def __init__( class EndpointDependency(msrest.serialization.Model): """A domain name that AKS agent nodes are reaching at. - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] """ _attribute_map = { @@ -1043,6 +1372,13 @@ def __init__( endpoint_details: Optional[List["EndpointDetail"]] = None, **kwargs ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] + """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name self.endpoint_details = endpoint_details @@ -1051,14 +1387,14 @@ def __init__( class EndpointDetail(msrest.serialization.Model): """connect information from the AKS agent nodes to a single endpoint. - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str """ _attribute_map = { @@ -1077,6 +1413,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ super(EndpointDetail, self).__init__(**kwargs) self.ip_address = ip_address self.port = port @@ -1087,10 +1433,10 @@ def __init__( class ExtendedLocation(msrest.serialization.Model): """The complex type of the extended location. - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1105,6 +1451,12 @@ def __init__( type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes + """ super(ExtendedLocation, self).__init__(**kwargs) self.name = name self.type = type @@ -1113,40 +1465,40 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies `_ for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager `_. The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1183,6 +1535,42 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1200,19 +1588,19 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1231,6 +1619,21 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1252,11 +1655,11 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system metadata relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied + :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] """ _validation = { @@ -1282,6 +1685,13 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1293,8 +1703,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1314,6 +1724,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1332,10 +1747,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1360,6 +1775,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1381,32 +1802,32 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str + :vartype kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str :ivar fqdn: The FQDN of the master pool. :vartype fqdn: str :ivar private_fqdn: The FQDN of private cluster. @@ -1415,72 +1836,72 @@ class ManagedCluster(Resource): headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity + :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. - :type pod_identity_profile: + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: + :ivar disk_encryption_set_id: This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile - :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + :ivar public_network_access: Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". - :type public_network_access: str or + :vartype public_network_access: str or ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess """ @@ -1572,6 +1993,97 @@ def __init__( public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile + :keyword public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". + :paramtype public_network_access: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.extended_location = extended_location @@ -1611,22 +2123,22 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """For more details see `managed AAD on AKS `_. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1651,6 +2163,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1674,12 +2204,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1706,6 +2236,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1717,10 +2255,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfileIdentity @@ -1744,6 +2282,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1753,12 +2297,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """Details about a user assigned identity. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1775,6 +2319,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1784,12 +2336,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1806,6 +2358,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1814,137 +2374,139 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Desired Number of agents (VMs) specified to host docker containers. Allowed - values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to - 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :ivar count: Desired Number of agents (VMs) specified to host docker containers. Allowed values + must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 + (inclusive) for system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData """ _validation = { @@ -2037,6 +2599,137 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Desired Number of agents (VMs) specified to host docker containers. Allowed + values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to + 1000 (inclusive) for system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2086,139 +2779,141 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Desired Number of agents (VMs) specified to host docker containers. Allowed - values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to - 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :ivar count: Desired Number of agents (VMs) specified to host docker containers. Allowed values + must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 + (inclusive) for system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str :ivar power_state: Describes whether the Agent Pool is Running or Stopped. :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :ivar name: Required. Windows agent pool names must be 6 characters or less. + :vartype name: str """ _validation = { @@ -2314,6 +3009,139 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Desired Number of agents (VMs) specified to host docker containers. Allowed + values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to + 1000 (inclusive) for system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :keyword name: Required. Windows agent pool names must be 6 characters or less. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, workload_runtime=workload_runtime, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, creation_data=creation_data, **kwargs) self.name = name @@ -2321,23 +3149,23 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see `API server authorized IP ranges `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private cluster or not. - :type enable_private_cluster_public_fqdn: bool - :param disable_run_command: Whether to disable run command for the cluster or not. - :type disable_run_command: bool + :vartype enable_private_cluster_public_fqdn: bool + :ivar disable_run_command: Whether to disable run command for the cluster or not. + :vartype disable_run_command: bool """ _attribute_map = { @@ -2358,6 +3186,25 @@ def __init__( disable_run_command: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :paramtype enable_private_cluster_public_fqdn: bool + :keyword disable_run_command: Whether to disable run command for the cluster or not. + :paramtype disable_run_command: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2369,10 +3216,10 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. Possible values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel """ _attribute_map = { @@ -2385,6 +3232,13 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Possible values include: "rapid", "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2392,14 +3246,14 @@ def __init__( class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): """Cluster HTTP proxy configuration. - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str """ _attribute_map = { @@ -2418,6 +3272,16 @@ def __init__( trusted_ca: Optional[str] = None, **kwargs ): + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) self.http_proxy = http_proxy self.https_proxy = https_proxy @@ -2436,13 +3300,13 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS + :ivar type: For more information see `use managed identities in AKS `_. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: + :vartype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ @@ -2465,6 +3329,16 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2477,8 +3351,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2498,6 +3372,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2506,30 +3384,29 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS cluster or not. - :type enable_multiple_standard_load_balancers: bool + :vartype enable_multiple_standard_load_balancers: bool """ _validation = { @@ -2559,6 +3436,32 @@ def __init__( enable_multiple_standard_load_balancers: Optional[bool] = None, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2572,9 +3475,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + :ivar count: The desired number of outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2591,6 +3494,12 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2598,8 +3507,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] """ @@ -2613,6 +3522,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2620,8 +3534,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] """ _attribute_map = { @@ -2634,6 +3548,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2641,9 +3559,9 @@ def __init__( class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): """Profile of the managed outbound IP resources of the managed cluster. - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2660,6 +3578,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) self.count = count @@ -2667,16 +3590,16 @@ def __init__( class ManagedClusterNATGatewayProfile(msrest.serialization.Model): """Profile of the managed cluster NAT gateway. - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. - :type managed_outbound_ip_profile: + :vartype managed_outbound_ip_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2697,6 +3620,19 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 4, **kwargs ): + """ + :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the + cluster NAT gateway. + :paramtype managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) self.managed_outbound_ip_profile = managed_outbound_ip_profile self.effective_outbound_i_ps = effective_outbound_i_ps @@ -2710,14 +3646,14 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity + :ivar name: Required. The name of the pod identity. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. The user assigned identity details. + :vartype identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2753,6 +3689,16 @@ def __init__( binding_selector: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The name of the pod identity. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. The user assigned identity details. + :paramtype identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2767,12 +3713,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. The name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. The pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2795,6 +3741,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. The name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. The pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2804,19 +3758,19 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """See `use AAD pod identity `_ for more details on pod identity integration. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity `_ for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: The pod identities to use in the cluster. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] """ @@ -2836,6 +3790,22 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: The pod identities to use in the cluster. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2846,8 +3816,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param error: Details about the error. - :type error: + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ @@ -2861,6 +3831,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) self.error = error @@ -2868,17 +3843,17 @@ def __init__( class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ @@ -2898,6 +3873,20 @@ def __init__( details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -2908,8 +3897,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError """ @@ -2923,6 +3912,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2932,15 +3926,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :vartype name: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2965,6 +3959,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :paramtype name: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2975,10 +3981,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -2993,6 +3999,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -3001,53 +4013,52 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar expander: If not specified, the default is 'random'. See `expanders `_ for more information. Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + :vartype expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander + :ivar max_empty_bulk_delete: The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -3092,6 +4103,55 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander + :keyword max_empty_bulk_delete: The default is 10. + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: The default is 600. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -3115,8 +4175,8 @@ def __init__( class ManagedClusterSecurityProfile(msrest.serialization.Model): """Security profile for the container service cluster. - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: + :ivar azure_defender: Azure Defender settings for the security profile. + :vartype azure_defender: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender """ @@ -3130,6 +4190,11 @@ def __init__( azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, **kwargs ): + """ + :keyword azure_defender: Azure Defender settings for the security profile. + :paramtype azure_defender: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender + """ super(ManagedClusterSecurityProfile, self).__init__(**kwargs) self.azure_defender = azure_defender @@ -3137,12 +4202,13 @@ def __init__( class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): """Azure Defender settings for the security profile. - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + :ivar enabled: Whether to enable Azure Defender. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :vartype log_analytics_workspace_resource_id: str """ _attribute_map = { @@ -3157,6 +4223,15 @@ def __init__( log_analytics_workspace_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword enabled: Whether to enable Azure Defender. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :paramtype log_analytics_workspace_resource_id: str + """ super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) self.enabled = enabled self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id @@ -3167,10 +4242,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -3189,6 +4264,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -3197,12 +4278,12 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """The SKU of a Managed Cluster. - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA + :ivar name: The name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA `_ for more details. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier + :vartype tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -3217,6 +4298,14 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: The name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -3235,12 +4324,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3267,6 +4356,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3280,29 +4378,29 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + :vartype admin_password: str + :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType + :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. - :type enable_csi_proxy: bool + :vartype enable_csi_proxy: bool """ _validation = { @@ -3325,6 +4423,31 @@ def __init__( enable_csi_proxy: Optional[bool] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType + :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :paramtype enable_csi_proxy: bool + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3357,6 +4480,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -3383,6 +4508,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3428,6 +4555,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3450,8 +4579,8 @@ class OSOptionProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the OS option resource. :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: + :ivar os_option_property_list: Required. The list of OS options. + :vartype os_option_property_list: list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] """ @@ -3475,6 +4604,11 @@ def __init__( os_option_property_list: List["OSOptionProperty"], **kwargs ): + """ + :keyword os_option_property_list: Required. The list of OS options. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] + """ super(OSOptionProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3487,10 +4621,10 @@ class OSOptionProperty(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool + :ivar os_type: Required. The OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether the image is FIPS-enabled. + :vartype enable_fips_image: bool """ _validation = { @@ -3510,6 +4644,12 @@ def __init__( enable_fips_image: bool, **kwargs ): + """ + :keyword os_type: Required. The OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether the image is FIPS-enabled. + :paramtype enable_fips_image: bool + """ super(OSOptionProperty, self).__init__(**kwargs) self.os_type = os_type self.enable_fips_image = enable_fips_image @@ -3518,11 +4658,11 @@ def __init__( class OutboundEnvironmentEndpoint(msrest.serialization.Model): """Egress endpoints which AKS agent nodes connect to for common purpose. - :param category: The category of endpoints accessed by the AKS agent node, e.g. + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] """ _attribute_map = { @@ -3537,6 +4677,13 @@ def __init__( endpoints: Optional[List["EndpointDependency"]] = None, **kwargs ): + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] + """ super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) self.category = category self.endpoints = endpoints @@ -3549,8 +4696,9 @@ class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] + :ivar value: Required. Collection of resources. + :vartype value: + list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3571,6 +4719,11 @@ def __init__( value: List["OutboundEnvironmentEndpoint"], **kwargs ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] + """ super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) self.value = value self.next_link = None @@ -3579,9 +4732,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code """ _attribute_map = { @@ -3594,6 +4747,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3601,8 +4759,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource ID of the private endpoint. - :type id: str + :ivar id: The resource ID of the private endpoint. + :vartype id: str """ _attribute_map = { @@ -3615,6 +4773,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3634,11 +4796,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState """ @@ -3665,6 +4827,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3677,8 +4847,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3691,6 +4861,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3700,16 +4875,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3738,6 +4913,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3750,8 +4937,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3764,6 +4951,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3771,11 +4962,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3790,6 +4981,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3798,8 +4996,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3812,6 +5010,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3821,12 +5023,12 @@ class RunCommandRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str + :ivar command: Required. The command to run. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str """ _validation = { @@ -3847,6 +5049,14 @@ def __init__( cluster_token: Optional[str] = None, **kwargs ): + """ + :keyword command: Required. The command to run. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ super(RunCommandRequest, self).__init__(**kwargs) self.command = command self.context = context @@ -3898,6 +5108,8 @@ def __init__( self, **kwargs ): + """ + """ super(RunCommandResult, self).__init__(**kwargs) self.id = None self.provisioning_state = None @@ -3921,18 +5133,18 @@ class Snapshot(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar system_data: The system metadata relating to this snapshot. :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData - :param creation_data: CreationData to be used to specify the source agent pool resource ID to + :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData - :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + :vartype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :ivar snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: "NodePool". Default value: "NodePool". - :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType + :vartype snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType """ _validation = { @@ -3963,6 +5175,18 @@ def __init__( snapshot_type: Optional[Union[str, "SnapshotType"]] = "NodePool", **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :keyword snapshot_type: The type of a snapshot. The default is NodePool. Possible values + include: "NodePool". Default value: "NodePool". + :paramtype snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType + """ super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) self.system_data = None self.creation_data = creation_data @@ -3974,8 +5198,8 @@ class SnapshotListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of snapshots. - :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] + :ivar value: The list of snapshots. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] :ivar next_link: The URL to get the next set of snapshot results. :vartype next_link: str """ @@ -3995,6 +5219,10 @@ def __init__( value: Optional[List["Snapshot"]] = None, **kwargs ): + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] + """ super(SnapshotListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -4003,62 +5231,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -4125,6 +5353,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -4159,21 +5445,21 @@ def __init__( 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.containerservice.v2021_08_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :ivar created_at: The UTC timestamp of resource creation. + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -4196,6 +5482,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :keyword created_at: The UTC timestamp of resource creation. + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -4208,8 +5512,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -4222,6 +5526,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -4229,13 +5537,13 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + :vartype day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay + :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] + :vartype hour_slots: list[int] """ _attribute_map = { @@ -4250,6 +5558,15 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay + :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -4258,10 +5575,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -4276,6 +5593,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py index d83f6642250f..0a60c82c7389 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. @@ -64,7 +331,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -72,36 +340,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,19 +384,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the specified managed cluster agent pool. Gets the specified managed cluster agent pool. @@ -152,28 +418,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,49 +443,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -247,17 +494,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool in the specified managed cluster. Creates or updates an agent pool in the specified managed cluster. @@ -272,15 +521,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -293,28 +546,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -326,43 +572,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -375,14 +611,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool in the specified managed cluster. Deletes an agent pool in the specified managed cluster. @@ -395,15 +632,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -418,22 +657,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -445,16 +676,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets the upgrade profile for an agent pool. Gets the upgrade profile for an agent pool. @@ -475,28 +707,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,15 +732,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported Kubernetes versions for the specified agent pool. See `supported Kubernetes versions @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrades the node image version of an agent pool to the latest. Upgrading the node image version of an agent pool applies the newest OS and runtime updates to @@ -649,15 +856,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -672,25 +882,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,4 +904,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py index 9e5a0bf49af2..4501e87d0603 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -61,8 +219,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -70,36 +230,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,19 +274,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the specified maintenance configuration of a managed cluster. Gets the specified maintenance configuration of a managed cluster. @@ -150,28 +308,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,17 +333,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configuration in the specified managed cluster. Creates or updates a maintenance configuration in the specified managed cluster. @@ -218,33 +368,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -258,16 +398,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes a maintenance configuration. @@ -288,28 +430,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,3 +453,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py index e031f202d911..6b310d07c534 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py @@ -5,25 +5,785 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,13 +807,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_os_options( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OSOptionProfile" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": """Gets supported OS options in the specified subscription. Gets supported OS options in the specified subscription. @@ -72,28 +832,17 @@ def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -107,20 +856,24 @@ def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -128,34 +881,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -173,17 +921,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. @@ -191,8 +940,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -200,35 +951,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -246,18 +993,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets the upgrade profile of a managed cluster. Gets the upgrade profile of a managed cluster. @@ -276,27 +1024,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,16 +1048,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials @@ -343,28 +1083,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,16 +1108,18 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the admin credentials of a managed cluster. Lists the admin credentials of a managed cluster. @@ -408,29 +1140,18 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -444,16 +1165,18 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the user credentials of a managed cluster. Lists the user credentials of a managed cluster. @@ -474,29 +1197,18 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,16 +1222,18 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the cluster monitoring user credentials of a managed cluster. Lists the cluster monitoring user credentials of a managed cluster. @@ -540,29 +1254,18 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -576,15 +1279,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets a managed cluster. @@ -603,27 +1308,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -637,47 +1332,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -695,16 +1381,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster. @@ -717,15 +1405,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -737,27 +1430,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -769,47 +1456,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -823,16 +1500,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates tags on a managed cluster. @@ -845,15 +1524,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -865,27 +1549,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -897,41 +1575,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -944,13 +1612,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes a managed cluster. @@ -961,15 +1630,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -983,21 +1654,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1009,47 +1673,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1062,14 +1716,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the Service Principal Profile of a managed cluster. This action cannot be performed on a cluster that is not using a service principal. @@ -1079,18 +1734,22 @@ def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1102,24 +1761,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1131,47 +1784,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1184,14 +1827,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. Reset the AAD Profile of a managed cluster. @@ -1204,15 +1848,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1224,24 +1871,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1253,41 +1894,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-08-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1300,13 +1931,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotates the certificates of a managed cluster. See `Certificate rotation `_ for @@ -1318,15 +1950,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1340,21 +1974,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,41 +1993,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-08-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1413,13 +2030,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stops a Managed Cluster. This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a @@ -1434,15 +2052,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1456,21 +2076,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,41 +2095,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-08-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1529,13 +2132,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Starts a previously stopped Managed Cluster. See `starting a cluster `_ for more @@ -1547,15 +2151,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1569,21 +2175,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1595,47 +2194,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore def _run_command_initial( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1651,16 +2240,18 @@ def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace def begin_run_command( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: """Submits a command to run against the Managed Cluster. AKS will create a pod to run the command. This is primarily useful for private clusters. For @@ -1675,15 +2266,20 @@ def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1695,27 +2291,21 @@ def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1727,16 +2317,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace def get_command_result( self, - resource_group_name, # type: str - resource_name, # type: str - command_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: """Gets the results of a command which has been run on the Managed Cluster. Gets the results of a command which has been run on the Managed Cluster. @@ -1757,28 +2348,18 @@ def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1794,16 +2375,19 @@ def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1813,8 +2397,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1822,36 +2408,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1869,6 +2452,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py index 82667caa7f0d..9497a127c49d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,18 +72,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of operations. Gets a list of operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -64,30 +92,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,6 +130,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py index a30cbec19e12..9aafff15e6b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. To learn more about private clusters, see: @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection. To learn more about private clusters, see: @@ -137,28 +287,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -172,17 +312,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection. @@ -205,33 +347,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -245,43 +377,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-08-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,14 +417,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes a private endpoint connection. @@ -314,15 +438,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -337,22 +463,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -364,4 +482,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py index 9daaf5960b07..c08c2e5e1d4c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. To learn more about private clusters, see: @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py index 652ce0ee7d87..e0cd2896fc07 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID for the specified managed cluster. @@ -72,32 +119,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -111,4 +148,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py index fdbe3b380e0f..c80512cfcfc7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py @@ -5,23 +5,248 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class SnapshotsOperations(object): """SnapshotsOperations operations. @@ -45,18 +270,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SnapshotListResult"] + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: """Gets a list of snapshots in the specified subscription. Gets a list of snapshots in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -64,34 +290,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,17 +330,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SnapshotListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: """Lists snapshots in the specified subscription and resource group. Lists snapshots in the specified subscription and resource group. @@ -128,7 +350,8 @@ def list_by_resource_group( :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 SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -136,35 +359,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,18 +401,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": """Gets a snapshot. Gets a snapshot. @@ -212,27 +432,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -246,16 +456,18 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.Snapshot" - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": """Creates or updates a snapshot. Creates or updates a snapshot. @@ -276,32 +488,22 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Snapshot') - 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 @@ -319,16 +521,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": """Updates tags on a snapshot. Updates tags on a snapshot. @@ -349,32 +553,22 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -388,15 +582,17 @@ def update_tags( return cls(pipeline_response, deserialized, {}) return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: """Deletes a snapshot. Deletes a snapshot. @@ -415,27 +611,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-08-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -447,3 +633,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py index 94fa86d82cb7..a74d3c9ae581 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_container_service_client.py index 96f3c54e0be5..50b01af9467f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_container_service_client.py @@ -6,109 +6,105 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .operations import SnapshotsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_09_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_09_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_09_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_09_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_09_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_09_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_09_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_09_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_09_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_09_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_09_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_09_01.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.v2021_09_01.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_metadata.json index 812cf59222cf..4fd5269c6fc2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py index 40270e51dd83..0f6b9aa15f88 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_container_service_client.py index 43a61934ffbc..1d686dada36d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_container_service_client.py @@ -6,105 +6,106 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .operations import SnapshotsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_09_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_09_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_09_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_09_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_09_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_09_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_09_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_09_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_09_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_09_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_09_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_09_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_09_01.aio.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.v2021_09_01.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py index e28d9038a7c7..1b42c3fda097 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -59,7 +65,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -67,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -114,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -181,8 +177,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -196,33 +194,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -240,8 +228,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -264,15 +255,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -285,28 +281,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -318,6 +307,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -332,28 +322,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -366,6 +346,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -385,15 +367,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -408,22 +392,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -435,8 +411,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -464,28 +442,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +467,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -612,8 +565,11 @@ async def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -635,15 +591,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -658,25 +618,17 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -688,4 +640,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py index ff6253b9be3b..e887984962c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -56,8 +62,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -65,36 +73,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -144,28 +151,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -179,8 +176,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -211,33 +211,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -251,8 +241,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -280,28 +273,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,3 +296,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py index 2fb988a55e38..68edbbf3f9a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_outbound_network_dependencies_endpoints_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get_os_options( self, location: str, @@ -67,28 +73,17 @@ async def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -102,8 +97,11 @@ async def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -113,8 +111,10 @@ def list( Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -122,34 +122,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -167,11 +162,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -184,8 +181,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -193,35 +192,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -239,11 +234,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -268,27 +265,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -302,8 +289,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -334,28 +324,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +349,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -398,29 +381,18 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -434,8 +406,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -463,29 +438,18 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +463,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -528,29 +495,18 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -564,8 +520,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -590,27 +549,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -624,8 +573,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -638,32 +589,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -681,8 +622,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -702,15 +646,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -722,27 +671,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -754,6 +697,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -768,32 +712,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -807,8 +741,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -828,15 +765,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -848,27 +790,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -880,6 +816,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -893,27 +830,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -926,6 +853,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -942,15 +871,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -964,21 +895,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -990,6 +914,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -1004,32 +929,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1042,6 +957,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -1058,18 +975,22 @@ async def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1081,24 +1002,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1110,6 +1025,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1124,32 +1040,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1162,6 +1068,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1181,15 +1089,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1201,24 +1112,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1230,6 +1135,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1243,27 +1149,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1276,6 +1172,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1293,15 +1191,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1315,21 +1215,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,6 +1234,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1354,27 +1248,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1387,6 +1271,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1407,15 +1293,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1429,21 +1317,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1455,6 +1336,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1468,27 +1350,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1501,6 +1373,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1518,15 +1392,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1540,21 +1416,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,6 +1435,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore async def _run_command_initial( @@ -1580,32 +1450,22 @@ async def _run_command_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1621,8 +1481,11 @@ async def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async async def begin_run_command( self, resource_group_name: str, @@ -1644,15 +1507,20 @@ async def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_09_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1664,27 +1532,21 @@ async def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1696,8 +1558,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace_async async def get_command_result( self, resource_group_name: str, @@ -1725,28 +1589,18 @@ async def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1762,15 +1616,19 @@ async def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1780,8 +1638,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1789,36 +1649,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1836,6 +1693,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py index 3b4ec0d14b27..d4c78f8b834e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -59,30 +66,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -100,6 +104,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py index 8e3a7384394c..f0926eb33ac0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -131,28 +129,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -166,8 +154,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -198,33 +189,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -238,8 +219,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -252,28 +235,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -286,6 +259,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -305,15 +280,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -328,22 +305,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -355,4 +324,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py index a247203e0afd..4b8ee020fb56 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py index e0f019dcc159..51fa894fef3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -67,32 +72,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -106,4 +101,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py index 506c178f49ad..25776af9cc7f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._snapshots_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -59,34 +66,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +106,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -122,7 +126,8 @@ def list_by_resource_group( :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 SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -130,35 +135,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -176,11 +177,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -205,27 +208,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -239,8 +232,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -268,32 +264,22 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Snapshot') - 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 @@ -311,8 +297,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def update_tags( self, resource_group_name: str, @@ -340,32 +329,22 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -379,8 +358,11 @@ async def update_tags( return cls(pipeline_response, deserialized, {}) return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -405,27 +387,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -437,3 +409,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/__init__.py index 127eebcc7447..7efcc102cc76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/__init__.py @@ -6,180 +6,93 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CreationData - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import EndpointDependency - from ._models_py3 import EndpointDetail - from ._models_py3 import ExtendedLocation - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterHTTPProxyConfig - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterManagedOutboundIPProfile - from ._models_py3 import ManagedClusterNATGatewayProfile - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningError - from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterSecurityProfile - from ._models_py3 import ManagedClusterSecurityProfileAzureDefender - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue - from ._models_py3 import OSOptionProfile - from ._models_py3 import OSOptionProperty - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OutboundEnvironmentEndpoint - from ._models_py3 import OutboundEnvironmentEndpointCollection - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import RunCommandRequest - from ._models_py3 import RunCommandResult - from ._models_py3 import Snapshot - from ._models_py3 import SnapshotListResult - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import WindowsGmsaProfile -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CreationData # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import EndpointDependency # type: ignore - from ._models import EndpointDetail # type: ignore - from ._models import ExtendedLocation # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterHTTPProxyConfig # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterManagedOutboundIPProfile # type: ignore - from ._models import ManagedClusterNATGatewayProfile # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterSecurityProfile # type: ignore - from ._models import ManagedClusterSecurityProfileAzureDefender # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import OSOptionProfile # type: ignore - from ._models import OSOptionProperty # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OutboundEnvironmentEndpoint # type: ignore - from ._models import OutboundEnvironmentEndpointCollection # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import RunCommandRequest # type: ignore - from ._models import RunCommandResult # type: ignore - from ._models import Snapshot # type: ignore - from ._models import SnapshotListResult # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import WindowsGmsaProfile # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileAzureDefender +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import WindowsGmsaProfile + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_container_service_client_enums.py index 9eeb9d5f0677..54490bab6467 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools @@ -39,7 +24,7 @@ class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: User agent pools are primarily for hosting your application pods. USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of Agent Pool. """ @@ -48,7 +33,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use of this is strongly discouraged. AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ @@ -57,7 +42,7 @@ class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The cluster is stopped. STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -66,7 +51,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice of orchestrator. """ @@ -74,7 +59,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. Note: This is no longer maintained. """ @@ -253,7 +238,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -262,7 +247,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -271,7 +256,7 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'random'. See `expanders `_ for more information. @@ -294,13 +279,13 @@ class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Used when you don't have a particular need for the node groups to scale differently. RANDOM = "random" -class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of extendedLocation. """ EDGE_ZONE = "EdgeZone" -class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. """ @@ -310,7 +295,7 @@ class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIG4_G = "MIG4g" MIG7_G = "MIG7g" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. """ @@ -320,7 +305,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Kubelet will use the temporary disk for its data. TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. """ @@ -330,7 +315,7 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Enables Azure Hybrid User Benefits for Windows VMs. WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. @@ -343,7 +328,7 @@ class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use a basic Load Balancer with limited functionality. BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -352,13 +337,13 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'Free'. See `uptime SLA `_ for more details. """ @@ -369,7 +354,7 @@ class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This cannot be specified if networkPlugin is anything other than 'azure'. """ @@ -380,7 +365,7 @@ class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: This is no longer supported. BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building the Kubernetes network. """ @@ -393,7 +378,7 @@ class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: information. KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building the Kubernetes network. """ @@ -406,7 +391,7 @@ class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: for more information. AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS @@ -422,14 +407,14 @@ class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: provides lower read/write latency, along with faster node scaling and cluster upgrades. EPHEMERAL = "Ephemeral" -class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies an OS SKU. This value must not be specified if OSType is Windows. """ UBUNTU = "Ubuntu" CBL_MARINER = "CBLMariner" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The operating system type. The default is Linux. """ @@ -438,7 +423,7 @@ class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use Windows. WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This can only be set at cluster creation time and cannot be changed later. For more information see `egress outbound type `_. """ @@ -458,7 +443,7 @@ class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: advanced scenario and requires proper network configuration. USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -467,7 +452,7 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PublicNetworkAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster """ @@ -475,7 +460,7 @@ class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ENABLED = "Enabled" DISABLED = "Disabled" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `use managed identities in AKS `_. """ @@ -491,7 +476,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. NONE = "None" -class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleDownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes how VMs are added to or removed from Agent Pools. See `billing states `_. """ @@ -502,7 +487,7 @@ class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: during scale down. DEALLOCATE = "Deallocate" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see `spot VMs `_ @@ -515,7 +500,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: cause issues with cluster scaling or upgrading. DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Virtual Machine Scale Set priority. """ @@ -525,14 +510,14 @@ class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Regular VMs will be used. REGULAR = "Regular" -class SnapshotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SnapshotType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of a snapshot. The default is NodePool. """ #: The snapshot is a snapshot of a node pool. NODE_POOL = "NodePool" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `setting the AKS cluster auto-upgrade channel `_. """ @@ -562,7 +547,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ @@ -574,7 +559,7 @@ class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class WorkloadRuntime(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WorkloadRuntime(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the type of workload a node can run. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models.py deleted file mode 100644 index cfbd39a41628..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models.py +++ /dev/null @@ -1,3899 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool - can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and - does not accrue billing charges. An Agent Pool can only be stopped if it is Running and - provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.workload_runtime = kwargs.get('workload_runtime', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = kwargs.get('power_state', None) - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - self.creation_data = kwargs.get('creation_data', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the agent pool version list. - :vartype id: str - :ivar name: The name of the agent pool version list. - :vartype name: str - :ivar type: Type of the agent pool version list. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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 ID of the agent pool upgrade profile. - :vartype id: str - :ivar name: The name of the agent pool upgrade profile. - :vartype name: str - :ivar type: The type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). - If a percentage is specified, it is the percentage of the total agent pool size at the time of - the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is - 1. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_09_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_09_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. - Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type - `_. Possible values include: - "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default - value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs - `_ for more information about the - differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterNATGatewayProfile - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - self.nat_gateway_profile = kwargs.get('nat_gateway_profile', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. A maximum of 1 key may be specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CreationData(msrest.serialization.Model): - """Data used when creating a target resource from a source resource. - - :param source_resource_id: This is the ARM ID of the source object to be used to create the - target object. - :type source_resource_id: str - """ - - _attribute_map = { - 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreationData, self).__init__(**kwargs) - self.source_resource_id = kwargs.get('source_resource_id', None) - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_09_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class EndpointDependency(msrest.serialization.Model): - """A domain name that AKS agent nodes are reaching at. - - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDependency, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class EndpointDetail(msrest.serialization.Model): - """connect information from the AKS agent nodes to a single endpoint. - - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDetail, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - self.port = kwargs.get('port', None) - self.protocol = kwargs.get('protocol', None) - self.description = kwargs.get('description', None) - - -class ExtendedLocation(msrest.serialization.Model): - """The complex type of the extended location. - - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocationTypes - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtendedLocation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class KubeletConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies - `_ - for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal - numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported - units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is - 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default - is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager - `_. The default is - 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_09_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The - default is 'always'. For more information see `Transparent Hugepages - `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', - 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent - Hugepages - `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """See `planned maintenance `_ for more information about planned maintenance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_09_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied - configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions - cannot be skipped. All upgrades must be performed sequentially by major version number. For - example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> - 1.16.x is not allowed. See `upgrading an AKS cluster - `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str - :ivar fqdn: The FQDN of the master pool. - :vartype fqdn: str - :ivar private_fqdn: The FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) - headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. - This special FQDN supports CORS, allowing the Azure Portal to function properly. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity - `_ for more details on AAD pod - identity integration. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for - this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details - see `disable local accounts - `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSecurityProfile - :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to - 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". - :type public_network_access: str or - ~azure.mgmt.containerservice.v2021_09_01.models.PublicNetworkAccess - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'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': 'ManagedClusterSKU'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - self.security_profile = kwargs.get('security_profile', None) - self.public_network_access = kwargs.get('public_network_access', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """For more details see `managed AAD on AKS `_. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """Details about a user assigned identity. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool - can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and - does not accrue billing charges. An Agent Pool can only be stopped if it is Running and - provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.workload_runtime = kwargs.get('workload_runtime', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = kwargs.get('power_state', None) - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - self.creation_data = kwargs.get('creation_data', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool - can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and - does not accrue billing charges. An Agent Pool can only be stopped if it is Running and - provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. - This feature is not compatible with clusters that use Public IP Per Node, or clusters that are - using a Basic Load Balancer. For more information see `API server authorized IP ranges - `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster - `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private - cluster or not. - :type enable_private_cluster_public_fqdn: bool - :param disable_run_command: Whether to disable run command for the cluster or not. - :type disable_run_command: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, - 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) - self.disable_run_command = kwargs.get('disable_run_command', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel - `_. Possible - values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_09_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): - """Cluster HTTP proxy configuration. - - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str - """ - - _attribute_map = { - 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, - 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, - 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, - 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) - self.http_proxy = kwargs.get('http_proxy', None) - self.https_proxy = kwargs.get('https_proxy', None) - self.no_proxy = kwargs.get('no_proxy', None) - self.trusted_ca = kwargs.get('trusted_ca', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS - `_. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed - values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in - Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS - cluster or not. - :type enable_multiple_standard_load_balancers: bool - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - self.enable_multiple_standard_load_balancers = kwargs.get('enable_multiple_standard_load_balancers', None) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load - balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): - """Profile of the managed outbound IP resources of the managed cluster. - - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must - be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 16, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterNATGatewayProfile(msrest.serialization.Model): - """Profile of the managed cluster NAT gateway. - - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster - NAT gateway. - :type managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) - self.managed_outbound_ip_profile = kwargs.get('managed_outbound_ip_profile', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 4) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """Details about the pod identity assigned to the Managed Cluster. - - Variables are only 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 name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.binding_selector = kwargs.get('binding_selector', None) - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """See `use AAD pod identity `_ for more details on pod identity integration. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the - security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet - network plugin with AAD Pod Identity - `_ - for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: - list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders - `_ - for more information. Possible values include: "least-waste", "most-pods", "priority", - "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_09_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to - act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore - unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer - followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by - an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an - integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed - by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterSecurityProfile(msrest.serialization.Model): - """Security profile for the container service cluster. - - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSecurityProfileAzureDefender - """ - - _attribute_map = { - 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfile, self).__init__(**kwargs) - self.azure_defender = kwargs.get('azure_defender', None) - - -class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): - """Azure Defender settings for the security profile. - - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be - associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.log_analytics_workspace_resource_id = kwargs.get('log_analytics_workspace_resource_id', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """The SKU of a Managed Cluster. - - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA - `_ for more details. Possible values include: - "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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 ID of the upgrade profile. - :vartype id: str - :ivar name: The name of the upgrade profile. - :vartype name: str - :ivar type: The type of the upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Possible values - include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo - `_. - :type enable_csi_proxy: bool - :param gmsa_profile: The Windows gMSA Profile in the Managed Cluster. - :type gmsa_profile: ~azure.mgmt.containerservice.v2021_09_01.models.WindowsGmsaProfile - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, - 'gmsa_profile': {'key': 'gmsaProfile', 'type': 'WindowsGmsaProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) - self.gmsa_profile = kwargs.get('gmsa_profile', None) - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class OperationListResult(msrest.serialization.Model): - """The List Operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the operation. - :vartype origin: str - :ivar name: The name of the operation. - :vartype name: str - :ivar operation: The display name of the operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSOptionProfile(msrest.serialization.Model): - """The OS option profile. - - Variables are only 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 ID of the OS option resource. - :vartype id: str - :ivar name: The name of the OS option resource. - :vartype name: str - :ivar type: The type of the OS option resource. - :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: - list[~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProperty] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.os_option_property_list = kwargs['os_option_property_list'] - - -class OSOptionProperty(msrest.serialization.Model): - """OS option property. - - All required parameters must be populated in order to send to Azure. - - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool - """ - - _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, - } - - _attribute_map = { - 'os_type': {'key': 'os-type', 'type': 'str'}, - 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProperty, self).__init__(**kwargs) - self.os_type = kwargs['os_type'] - self.enable_fips_image = kwargs['enable_fips_image'] - - -class OutboundEnvironmentEndpoint(msrest.serialization.Model): - """Egress endpoints which AKS agent nodes connect to for common purpose. - - :param category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDependency] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): - """Collection of OutboundEnvironmentEndpoint. - - Variables are only 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 value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_09_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource ID of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_09_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class RunCommandRequest(msrest.serialization.Model): - """A run command request. - - All required parameters must be populated in order to send to Azure. - - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str - """ - - _validation = { - 'command': {'required': True}, - } - - _attribute_map = { - 'command': {'key': 'command', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandRequest, self).__init__(**kwargs) - self.command = kwargs['command'] - self.context = kwargs.get('context', None) - self.cluster_token = kwargs.get('cluster_token', None) - - -class RunCommandResult(msrest.serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: The exit code of the command. - :vartype exit_code: int - :ivar started_at: The time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: The time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: The command output. - :vartype logs: str - :ivar reason: An explanation of why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'exit_code': {'readonly': True}, - 'started_at': {'readonly': True}, - 'finished_at': {'readonly': True}, - 'logs': {'readonly': True}, - 'reason': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, - 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, - 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, - 'logs': {'key': 'properties.logs', 'type': 'str'}, - 'reason': {'key': 'properties.reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandResult, self).__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None - - -class Snapshot(Resource): - """A node pool snapshot 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. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar system_data: The system metadata relating to this snapshot. - :vartype system_data: ~azure.mgmt.containerservice.v2021_09_01.models.SystemData - :param creation_data: CreationData to be used to specify the source agent pool resource ID to - create this snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData - :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: - "NodePool". Default value: "NodePool". - :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.SnapshotType - :ivar kubernetes_version: The version of Kubernetes. - :vartype kubernetes_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :ivar os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :vartype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :ivar vm_size: The size of the VM. - :vartype vm_size: str - :ivar enable_fips: Whether to use a FIPS-enabled OS. - :vartype enable_fips: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'kubernetes_version': {'readonly': True}, - 'node_image_version': {'readonly': True}, - 'os_type': {'readonly': True}, - 'os_sku': {'readonly': True}, - 'vm_size': {'readonly': True}, - 'enable_fips': {'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}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, - 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(Snapshot, self).__init__(**kwargs) - self.system_data = None - self.creation_data = kwargs.get('creation_data', None) - self.snapshot_type = kwargs.get('snapshot_type', "NodePool") - self.kubernetes_version = None - self.node_image_version = None - self.os_type = None - self.os_sku = None - self.vm_size = None - self.enable_fips = None - - -class SnapshotListResult(msrest.serialization.Model): - """The response from the List Snapshots operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of snapshots. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.Snapshot] - :ivar next_link: The URL to get the next set of snapshot results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Snapshot]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SnapshotListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_09_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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.containerservice.v2021_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_09_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour - ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 - UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) - - -class WindowsGmsaProfile(msrest.serialization.Model): - """Windows gMSA Profile in the managed cluster. - - :param enabled: Specifies whether to enable Windows gMSA in the managed cluster. - :type enabled: bool - :param dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it - to empty if you have configured the DNS server in the vnet which is used to create the managed - cluster. - :type dns_server: str - :param root_domain_name: Specifies the root domain name for Windows gMSA. - :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet - which is used to create the managed cluster. - :type root_domain_name: str - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'dns_server': {'key': 'dnsServer', 'type': 'str'}, - 'root_domain_name': {'key': 'rootDomainName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WindowsGmsaProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.dns_server = kwargs.get('dns_server', None) - self.root_domain_name = kwargs.get('root_domain_name', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py index c8b6b978c971..f255a3015473 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,141 +64,143 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode + :ivar type_properties_type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :vartype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData """ _validation = { @@ -295,6 +299,143 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode + :keyword type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -348,8 +489,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool version list. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -372,6 +513,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -382,12 +528,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -404,6 +550,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -415,8 +569,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -436,6 +590,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -454,16 +612,16 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str """ _validation = { @@ -493,6 +651,18 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: The latest AKS supported node image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -506,10 +676,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -524,6 +694,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -532,12 +708,12 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -550,6 +726,14 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -557,17 +741,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_09_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_09_01.models.CloudErrorBody] """ _attribute_map = { @@ -586,6 +770,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_09_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -598,8 +795,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceVMDiagnostics """ @@ -617,6 +814,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -626,10 +828,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -649,6 +851,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -661,12 +870,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_09_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_09_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -704,21 +913,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -747,13 +956,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_09_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -768,41 +1038,42 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building the Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building the Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPolicy + :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type + :vartype docker_bridge_cidr: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type `_. Possible values include: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OutboundType + :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_09_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterNATGatewayProfile """ @@ -843,6 +1114,45 @@ def __init__( nat_gateway_profile: Optional["ManagedClusterNATGatewayProfile"] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building the Kubernetes network. Possible + values include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building the Kubernetes network. Possible + values include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkPolicy + :keyword network_mode: This cannot be specified if networkPlugin is anything other than + 'azure'. Possible values include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OutboundType + :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_09_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterNATGatewayProfile + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -862,9 +1172,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshPublicKey] """ @@ -882,6 +1192,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. A maximum of 1 key may be specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -891,9 +1207,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -910,6 +1226,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -921,8 +1242,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -943,6 +1264,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -951,9 +1276,9 @@ def __init__( class CreationData(msrest.serialization.Model): """Data used when creating a target resource from a source resource. - :param source_resource_id: This is the ARM ID of the source object to be used to create the + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the target object. - :type source_resource_id: str + :vartype source_resource_id: str """ _attribute_map = { @@ -966,6 +1291,11 @@ def __init__( source_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ super(CreationData, self).__init__(**kwargs) self.source_resource_id = source_resource_id @@ -995,6 +1325,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1021,6 +1353,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1028,10 +1362,10 @@ def __init__( class EndpointDependency(msrest.serialization.Model): """A domain name that AKS agent nodes are reaching at. - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDetail] + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDetail] """ _attribute_map = { @@ -1046,6 +1380,13 @@ def __init__( endpoint_details: Optional[List["EndpointDetail"]] = None, **kwargs ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDetail] + """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name self.endpoint_details = endpoint_details @@ -1054,14 +1395,14 @@ def __init__( class EndpointDetail(msrest.serialization.Model): """connect information from the AKS agent nodes to a single endpoint. - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str """ _attribute_map = { @@ -1080,6 +1421,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ super(EndpointDetail, self).__init__(**kwargs) self.ip_address = ip_address self.port = port @@ -1090,10 +1441,10 @@ def __init__( class ExtendedLocation(msrest.serialization.Model): """The complex type of the extended location. - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocationTypes + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1108,6 +1459,12 @@ def __init__( type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocationTypes + """ super(ExtendedLocation, self).__init__(**kwargs) self.name = name self.type = type @@ -1116,40 +1473,40 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies `_ for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager `_. The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1186,6 +1543,42 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1203,19 +1596,19 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_09_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_09_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1234,6 +1627,21 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_09_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1255,11 +1663,11 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system metadata relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_09_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied + :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeSpan] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeSpan] """ _validation = { @@ -1285,6 +1693,13 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_09_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1296,8 +1711,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1317,6 +1732,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1335,10 +1755,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1363,6 +1783,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1384,32 +1810,32 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. :vartype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str + :vartype kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str :ivar fqdn: The FQDN of the master pool. :vartype fqdn: str :ivar private_fqdn: The FQDN of private cluster. @@ -1418,72 +1844,72 @@ class ManagedCluster(Resource): headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity + :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. - :type pod_identity_profile: + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: + :ivar disk_encryption_set_id: This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSecurityProfile - :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + :ivar public_network_access: Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". - :type public_network_access: str or + :vartype public_network_access: str or ~azure.mgmt.containerservice.v2021_09_01.models.PublicNetworkAccess """ @@ -1575,6 +2001,97 @@ def __init__( public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: ~azure.mgmt.containerservice.v2021_09_01.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSecurityProfile + :keyword public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". + :paramtype public_network_access: str or + ~azure.mgmt.containerservice.v2021_09_01.models.PublicNetworkAccess + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.extended_location = extended_location @@ -1614,22 +2131,22 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """For more details see `managed AAD on AKS `_. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1654,6 +2171,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1677,12 +2212,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1709,6 +2244,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1720,10 +2263,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAddonProfileIdentity @@ -1747,6 +2290,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1756,12 +2305,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """Details about a user assigned identity. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1778,6 +2327,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1787,12 +2344,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1809,6 +2366,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1817,140 +2382,142 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :vartype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData """ _validation = { @@ -2043,6 +2610,142 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2092,142 +2795,144 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :vartype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + :ivar name: Required. Windows agent pool names must be 6 characters or less. + :vartype name: str """ _validation = { @@ -2323,6 +3028,144 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_09_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_09_01.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_09_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_09_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_09_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_09_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + :keyword name: Required. Windows agent pool names must be 6 characters or less. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, workload_runtime=workload_runtime, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, power_state=power_state, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, creation_data=creation_data, **kwargs) self.name = name @@ -2330,23 +3173,23 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see `API server authorized IP ranges `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private cluster or not. - :type enable_private_cluster_public_fqdn: bool - :param disable_run_command: Whether to disable run command for the cluster or not. - :type disable_run_command: bool + :vartype enable_private_cluster_public_fqdn: bool + :ivar disable_run_command: Whether to disable run command for the cluster or not. + :vartype disable_run_command: bool """ _attribute_map = { @@ -2367,6 +3210,25 @@ def __init__( disable_run_command: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :paramtype enable_private_cluster_public_fqdn: bool + :keyword disable_run_command: Whether to disable run command for the cluster or not. + :paramtype disable_run_command: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2378,10 +3240,10 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. Possible values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_09_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_09_01.models.UpgradeChannel """ _attribute_map = { @@ -2394,6 +3256,13 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Possible values include: "rapid", "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_09_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2401,14 +3270,14 @@ def __init__( class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): """Cluster HTTP proxy configuration. - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str """ _attribute_map = { @@ -2427,6 +3296,16 @@ def __init__( trusted_ca: Optional[str] = None, **kwargs ): + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) self.http_proxy = http_proxy self.https_proxy = https_proxy @@ -2445,13 +3324,13 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS + :ivar type: For more information see `use managed identities in AKS `_. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: + :vartype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_09_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ @@ -2474,6 +3353,16 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_09_01.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2486,8 +3375,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2507,6 +3396,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2515,30 +3408,29 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS cluster or not. - :type enable_multiple_standard_load_balancers: bool + :vartype enable_multiple_standard_load_balancers: bool """ _validation = { @@ -2568,6 +3460,32 @@ def __init__( enable_multiple_standard_load_balancers: Optional[bool] = None, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] + :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2581,9 +3499,9 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + :ivar count: The desired number of outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2600,6 +3518,12 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :paramtype count: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count @@ -2607,8 +3531,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] """ @@ -2622,6 +3546,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2629,8 +3558,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] """ _attribute_map = { @@ -2643,6 +3572,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2650,9 +3583,9 @@ def __init__( class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): """Profile of the managed outbound IP resources of the managed cluster. - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2669,6 +3602,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) self.count = count @@ -2676,16 +3614,16 @@ def __init__( class ManagedClusterNATGatewayProfile(msrest.serialization.Model): """Profile of the managed cluster NAT gateway. - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. - :type managed_outbound_ip_profile: + :vartype managed_outbound_ip_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2706,6 +3644,19 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 4, **kwargs ): + """ + :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the + cluster NAT gateway. + :paramtype managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_09_01.models.ResourceReference] + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) self.managed_outbound_ip_profile = managed_outbound_ip_profile self.effective_outbound_i_ps = effective_outbound_i_ps @@ -2719,14 +3670,14 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity + :ivar name: Required. The name of the pod identity. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. The user assigned identity details. + :vartype identity: ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2762,6 +3713,16 @@ def __init__( binding_selector: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The name of the pod identity. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. The user assigned identity details. + :paramtype identity: ~azure.mgmt.containerservice.v2021_09_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2776,12 +3737,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. The name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. The pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2804,6 +3765,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. The name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. The pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2813,19 +3782,19 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """See `use AAD pod identity `_ for more details on pod identity integration. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity `_ for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: The pod identities to use in the cluster. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityException] """ @@ -2845,6 +3814,22 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: The pod identities to use in the cluster. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2855,8 +3840,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param error: Details about the error. - :type error: + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ @@ -2870,6 +3855,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) self.error = error @@ -2877,17 +3867,17 @@ def __init__( class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ @@ -2907,6 +3897,20 @@ def __init__( details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -2917,8 +3921,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningError """ @@ -2932,6 +3936,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPodIdentityProvisioningError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2941,15 +3950,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :vartype name: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -2974,6 +3983,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :paramtype name: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -2984,10 +4005,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -3002,6 +4023,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -3010,53 +4037,52 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar expander: If not specified, the default is 'random'. See `expanders `_ for more information. Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_09_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + :vartype expander: str or ~azure.mgmt.containerservice.v2021_09_01.models.Expander + :ivar max_empty_bulk_delete: The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -3101,6 +4127,55 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_09_01.models.Expander + :keyword max_empty_bulk_delete: The default is 10. + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: The default is 600. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -3124,8 +4199,8 @@ def __init__( class ManagedClusterSecurityProfile(msrest.serialization.Model): """Security profile for the container service cluster. - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: + :ivar azure_defender: Azure Defender settings for the security profile. + :vartype azure_defender: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSecurityProfileAzureDefender """ @@ -3139,6 +4214,11 @@ def __init__( azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, **kwargs ): + """ + :keyword azure_defender: Azure Defender settings for the security profile. + :paramtype azure_defender: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSecurityProfileAzureDefender + """ super(ManagedClusterSecurityProfile, self).__init__(**kwargs) self.azure_defender = azure_defender @@ -3146,12 +4226,13 @@ def __init__( class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): """Azure Defender settings for the security profile. - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + :ivar enabled: Whether to enable Azure Defender. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :vartype log_analytics_workspace_resource_id: str """ _attribute_map = { @@ -3166,6 +4247,15 @@ def __init__( log_analytics_workspace_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword enabled: Whether to enable Azure Defender. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :paramtype log_analytics_workspace_resource_id: str + """ super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) self.enabled = enabled self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id @@ -3176,10 +4266,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -3198,6 +4288,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -3206,12 +4302,12 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """The SKU of a Managed Cluster. - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA + :ivar name: The name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA `_ for more details. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUTier + :vartype tier: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -3226,6 +4322,14 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: The name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -3244,12 +4348,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3276,6 +4380,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3289,31 +4402,31 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + :vartype admin_password: str + :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.LicenseType + :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. - :type enable_csi_proxy: bool - :param gmsa_profile: The Windows gMSA Profile in the Managed Cluster. - :type gmsa_profile: ~azure.mgmt.containerservice.v2021_09_01.models.WindowsGmsaProfile + :vartype enable_csi_proxy: bool + :ivar gmsa_profile: The Windows gMSA Profile in the Managed Cluster. + :vartype gmsa_profile: ~azure.mgmt.containerservice.v2021_09_01.models.WindowsGmsaProfile """ _validation = { @@ -3338,6 +4451,33 @@ def __init__( gmsa_profile: Optional["WindowsGmsaProfile"] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.LicenseType + :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :paramtype enable_csi_proxy: bool + :keyword gmsa_profile: The Windows gMSA Profile in the Managed Cluster. + :paramtype gmsa_profile: ~azure.mgmt.containerservice.v2021_09_01.models.WindowsGmsaProfile + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3371,6 +4511,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -3397,6 +4539,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3442,6 +4586,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3464,8 +4610,8 @@ class OSOptionProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the OS option resource. :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: + :ivar os_option_property_list: Required. The list of OS options. + :vartype os_option_property_list: list[~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProperty] """ @@ -3489,6 +4635,11 @@ def __init__( os_option_property_list: List["OSOptionProperty"], **kwargs ): + """ + :keyword os_option_property_list: Required. The list of OS options. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProperty] + """ super(OSOptionProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3501,10 +4652,10 @@ class OSOptionProperty(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool + :ivar os_type: Required. The OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether the image is FIPS-enabled. + :vartype enable_fips_image: bool """ _validation = { @@ -3524,6 +4675,12 @@ def __init__( enable_fips_image: bool, **kwargs ): + """ + :keyword os_type: Required. The OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether the image is FIPS-enabled. + :paramtype enable_fips_image: bool + """ super(OSOptionProperty, self).__init__(**kwargs) self.os_type = os_type self.enable_fips_image = enable_fips_image @@ -3532,11 +4689,11 @@ def __init__( class OutboundEnvironmentEndpoint(msrest.serialization.Model): """Egress endpoints which AKS agent nodes connect to for common purpose. - :param category: The category of endpoints accessed by the AKS agent node, e.g. + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDependency] + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDependency] """ _attribute_map = { @@ -3551,6 +4708,13 @@ def __init__( endpoints: Optional[List["EndpointDependency"]] = None, **kwargs ): + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: list[~azure.mgmt.containerservice.v2021_09_01.models.EndpointDependency] + """ super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) self.category = category self.endpoints = endpoints @@ -3563,8 +4727,9 @@ class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpoint] + :ivar value: Required. Collection of resources. + :vartype value: + list[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3585,6 +4750,11 @@ def __init__( value: List["OutboundEnvironmentEndpoint"], **kwargs ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpoint] + """ super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) self.value = value self.next_link = None @@ -3593,9 +4763,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_09_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_09_01.models.Code """ _attribute_map = { @@ -3608,6 +4778,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_09_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3615,8 +4790,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource ID of the private endpoint. - :type id: str + :ivar id: The resource ID of the private endpoint. + :vartype id: str """ _attribute_map = { @@ -3629,6 +4804,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3648,11 +4827,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkServiceConnectionState """ @@ -3679,6 +4858,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3691,8 +4878,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3705,6 +4892,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3714,16 +4906,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3752,6 +4944,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3764,8 +4968,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3778,6 +4982,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3785,11 +4993,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_09_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_09_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3804,6 +5012,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_09_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3812,8 +5027,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3826,6 +5041,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3835,12 +5054,12 @@ class RunCommandRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str + :ivar command: Required. The command to run. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str """ _validation = { @@ -3861,6 +5080,14 @@ def __init__( cluster_token: Optional[str] = None, **kwargs ): + """ + :keyword command: Required. The command to run. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ super(RunCommandRequest, self).__init__(**kwargs) self.command = command self.context = context @@ -3912,6 +5139,8 @@ def __init__( self, **kwargs ): + """ + """ super(RunCommandResult, self).__init__(**kwargs) self.id = None self.provisioning_state = None @@ -3935,18 +5164,18 @@ class Snapshot(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar system_data: The system metadata relating to this snapshot. :vartype system_data: ~azure.mgmt.containerservice.v2021_09_01.models.SystemData - :param creation_data: CreationData to be used to specify the source agent pool resource ID to + :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData - :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + :vartype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + :ivar snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: "NodePool". Default value: "NodePool". - :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.SnapshotType + :vartype snapshot_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.SnapshotType :ivar kubernetes_version: The version of Kubernetes. :vartype kubernetes_version: str :ivar node_image_version: The version of node image. @@ -4003,6 +5232,18 @@ def __init__( snapshot_type: Optional[Union[str, "SnapshotType"]] = "NodePool", **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_09_01.models.CreationData + :keyword snapshot_type: The type of a snapshot. The default is NodePool. Possible values + include: "NodePool". Default value: "NodePool". + :paramtype snapshot_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.SnapshotType + """ super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) self.system_data = None self.creation_data = creation_data @@ -4020,8 +5261,8 @@ class SnapshotListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of snapshots. - :type value: list[~azure.mgmt.containerservice.v2021_09_01.models.Snapshot] + :ivar value: The list of snapshots. + :vartype value: list[~azure.mgmt.containerservice.v2021_09_01.models.Snapshot] :ivar next_link: The URL to get the next set of snapshot results. :vartype next_link: str """ @@ -4041,6 +5282,10 @@ def __init__( value: Optional[List["Snapshot"]] = None, **kwargs ): + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2021_09_01.models.Snapshot] + """ super(SnapshotListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -4049,62 +5294,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -4171,6 +5416,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -4205,21 +5508,21 @@ def __init__( 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.containerservice.v2021_09_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.CreatedByType + :ivar created_at: The UTC timestamp of resource creation. + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_09_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -4242,6 +5545,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.CreatedByType + :keyword created_at: The UTC timestamp of resource creation. + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_09_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -4254,8 +5575,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -4268,6 +5589,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -4275,13 +5600,13 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_09_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + :vartype day: str or ~azure.mgmt.containerservice.v2021_09_01.models.WeekDay + :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] + :vartype hour_slots: list[int] """ _attribute_map = { @@ -4296,6 +5621,15 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_09_01.models.WeekDay + :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -4304,10 +5638,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -4322,6 +5656,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end @@ -4330,16 +5670,16 @@ def __init__( class WindowsGmsaProfile(msrest.serialization.Model): """Windows gMSA Profile in the managed cluster. - :param enabled: Specifies whether to enable Windows gMSA in the managed cluster. - :type enabled: bool - :param dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it - to empty if you have configured the DNS server in the vnet which is used to create the managed + :ivar enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it to + empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - :type dns_server: str - :param root_domain_name: Specifies the root domain name for Windows gMSA. + :vartype dns_server: str + :ivar root_domain_name: Specifies the root domain name for Windows gMSA. :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - :type root_domain_name: str + :vartype root_domain_name: str """ _attribute_map = { @@ -4356,6 +5696,18 @@ def __init__( root_domain_name: Optional[str] = None, **kwargs ): + """ + :keyword enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :paramtype enabled: bool + :keyword dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it + to empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :paramtype dns_server: str + :keyword root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :paramtype root_domain_name: str + """ super(WindowsGmsaProfile, self).__init__(**kwargs) self.enabled = enabled self.dns_server = dns_server diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py index 8cc145aede38..92a3eb645612 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. @@ -64,7 +331,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -72,36 +340,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,19 +384,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the specified managed cluster agent pool. Gets the specified managed cluster agent pool. @@ -152,28 +418,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,49 +443,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -247,17 +494,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool in the specified managed cluster. Creates or updates an agent pool in the specified managed cluster. @@ -272,15 +521,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -293,28 +546,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -326,43 +572,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -375,14 +611,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool in the specified managed cluster. Deletes an agent pool in the specified managed cluster. @@ -395,15 +632,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -418,22 +657,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -445,16 +676,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets the upgrade profile for an agent pool. Gets the upgrade profile for an agent pool. @@ -475,28 +707,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,15 +732,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported Kubernetes versions for the specified agent pool. See `supported Kubernetes versions @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -625,16 +830,18 @@ def _upgrade_node_image_version_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrades the node image version of an agent pool to the latest. Upgrading the node image version of an agent pool applies the newest OS and runtime updates to @@ -649,15 +856,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -672,25 +882,17 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,4 +904,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py index f62449aaffeb..e701083e26ff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -61,8 +219,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -70,36 +230,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,19 +274,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the specified maintenance configuration of a managed cluster. Gets the specified maintenance configuration of a managed cluster. @@ -150,28 +308,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,17 +333,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configuration in the specified managed cluster. Creates or updates a maintenance configuration in the specified managed cluster. @@ -218,33 +368,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -258,16 +398,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes a maintenance configuration. @@ -288,28 +430,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,3 +453,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py index 34574646e0e9..05a01fd0e208 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py @@ -5,25 +5,785 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,13 +807,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_os_options( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OSOptionProfile" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": """Gets supported OS options in the specified subscription. Gets supported OS options in the specified subscription. @@ -72,28 +832,17 @@ def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -107,20 +856,24 @@ def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -128,34 +881,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -173,17 +921,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. @@ -191,8 +940,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -200,35 +951,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -246,18 +993,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets the upgrade profile of a managed cluster. Gets the upgrade profile of a managed cluster. @@ -276,27 +1024,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,16 +1048,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials @@ -343,28 +1083,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,16 +1108,18 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the admin credentials of a managed cluster. Lists the admin credentials of a managed cluster. @@ -408,29 +1140,18 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -444,16 +1165,18 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the user credentials of a managed cluster. Lists the user credentials of a managed cluster. @@ -474,29 +1197,18 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,16 +1222,18 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the cluster monitoring user credentials of a managed cluster. Lists the cluster monitoring user credentials of a managed cluster. @@ -540,29 +1254,18 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -576,15 +1279,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets a managed cluster. @@ -603,27 +1308,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -637,47 +1332,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -695,16 +1381,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster. @@ -717,15 +1405,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -737,27 +1430,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -769,47 +1456,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -823,16 +1500,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates tags on a managed cluster. @@ -845,15 +1524,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -865,27 +1549,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -897,41 +1575,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -944,13 +1612,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes a managed cluster. @@ -961,15 +1630,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -983,21 +1654,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1009,47 +1673,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1062,14 +1716,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the Service Principal Profile of a managed cluster. This action cannot be performed on a cluster that is not using a service principal. @@ -1079,18 +1734,22 @@ def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1102,24 +1761,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1131,47 +1784,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1184,14 +1827,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. Reset the AAD Profile of a managed cluster. @@ -1204,15 +1848,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1224,24 +1871,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1253,41 +1894,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-09-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1300,13 +1931,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotates the certificates of a managed cluster. See `Certificate rotation `_ for @@ -1318,15 +1950,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1340,21 +1974,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,41 +1993,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-09-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1413,13 +2030,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stops a Managed Cluster. This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a @@ -1434,15 +2052,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1456,21 +2076,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,41 +2095,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-09-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1529,13 +2132,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Starts a previously stopped Managed Cluster. See `starting a cluster `_ for more @@ -1547,15 +2151,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1569,21 +2175,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1595,47 +2194,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore def _run_command_initial( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1651,16 +2240,18 @@ def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace def begin_run_command( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: """Submits a command to run against the Managed Cluster. AKS will create a pod to run the command. This is primarily useful for private clusters. For @@ -1675,15 +2266,20 @@ def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_09_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1695,27 +2291,21 @@ def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1727,16 +2317,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace def get_command_result( self, - resource_group_name, # type: str - resource_name, # type: str - command_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: """Gets the results of a command which has been run on the Managed Cluster. Gets the results of a command which has been run on the Managed Cluster. @@ -1757,28 +2348,18 @@ def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1794,16 +2375,19 @@ def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1813,8 +2397,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1822,36 +2408,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1869,6 +2452,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py index f481df36ed74..17882f6db1cf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,18 +72,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of operations. Gets a list of operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -64,30 +92,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,6 +130,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py index 95e3d4391c38..8c61ae889c1e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. To learn more about private clusters, see: @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection. To learn more about private clusters, see: @@ -137,28 +287,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -172,17 +312,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection. @@ -205,33 +347,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -245,43 +377,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,14 +417,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes a private endpoint connection. @@ -314,15 +438,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -337,22 +463,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -364,4 +482,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py index ec68817b4032..380598f8a219 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. To learn more about private clusters, see: @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py index fb9cb7ac655f..a70901866fc7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID for the specified managed cluster. @@ -72,32 +119,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -111,4 +148,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py index a3a75a2347db..56c6355ee23e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py @@ -5,23 +5,248 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class SnapshotsOperations(object): """SnapshotsOperations operations. @@ -45,18 +270,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SnapshotListResult"] + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: """Gets a list of snapshots in the specified subscription. Gets a list of snapshots in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -64,34 +290,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,17 +330,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SnapshotListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: """Lists snapshots in the specified subscription and resource group. Lists snapshots in the specified subscription and resource group. @@ -128,7 +350,8 @@ def list_by_resource_group( :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 SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_09_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -136,35 +359,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,18 +401,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": """Gets a snapshot. Gets a snapshot. @@ -212,27 +432,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -246,16 +456,18 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.Snapshot" - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": """Creates or updates a snapshot. Creates or updates a snapshot. @@ -276,32 +488,22 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Snapshot') - 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 @@ -319,16 +521,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": """Updates tags on a snapshot. Updates tags on a snapshot. @@ -349,32 +553,22 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -388,15 +582,17 @@ def update_tags( return cls(pipeline_response, deserialized, {}) return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: """Deletes a snapshot. Deletes a snapshot. @@ -415,27 +611,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -447,3 +633,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py index eb3d7ba7a265..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py @@ -9,8 +9,7 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py index 861ab0b47e71..c42e6b7953d1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py @@ -6,16 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +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 +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential VERSION = "unknown" @@ -34,16 +32,15 @@ class ContainerServiceClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -67,4 +64,4 @@ def _configure( 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) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_container_service_client.py index 2a1d922c7712..4d5fbf4f8ebf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_container_service_client.py @@ -6,109 +6,105 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + 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 ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .operations import SnapshotsOperations -from . import models - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_10_01.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_10_01.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_10_01.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_10_01.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_10_01.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2021_10_01.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_10_01.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_10_01.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_10_01.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_10_01.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_10_01.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_10_01.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.v2021_10_01.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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 = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_metadata.json index 81a793b03af2..93121009fcd8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_metadata.json @@ -5,13 +5,13 @@ "name": "ContainerServiceClient", "filename": "_container_service_client", "description": "The Container Service Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "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\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/__init__.py index 4ad2bb20096a..53c675bd95e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._container_service_client import ContainerServiceClient __all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py index 0a521b492d83..4fe8c8a6d2aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,11 +36,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) 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(ContainerServiceClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -63,4 +63,4 @@ def _configure( 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) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_container_service_client.py index d2c510d4e1f8..655f06c1f3f4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_container_service_client.py @@ -6,105 +6,106 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import ContainerServiceClientConfiguration -from .operations import Operations -from .operations import ManagedClustersOperations -from .operations import MaintenanceConfigurationsOperations -from .operations import AgentPoolsOperations -from .operations import PrivateEndpointConnectionsOperations -from .operations import PrivateLinkResourcesOperations -from .operations import ResolvePrivateLinkServiceIdOperations -from .operations import SnapshotsOperations -from .. import models - - -class ContainerServiceClient(object): +class ContainerServiceClient: """The Container Service Client. :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2021_10_01.aio.operations.Operations :ivar managed_clusters: ManagedClustersOperations operations - :vartype managed_clusters: azure.mgmt.containerservice.v2021_10_01.aio.operations.ManagedClustersOperations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_10_01.aio.operations.ManagedClustersOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations - :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_10_01.aio.operations.MaintenanceConfigurationsOperations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_10_01.aio.operations.MaintenanceConfigurationsOperations :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.v2021_10_01.aio.operations.AgentPoolsOperations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_10_01.aio.operations.AgentPoolsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_10_01.aio.operations.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_10_01.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.containerservice.v2021_10_01.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_10_01.aio.operations.PrivateLinkResourcesOperations :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_10_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_10_01.aio.operations.ResolvePrivateLinkServiceIdOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.v2021_10_01.aio.operations.SnapshotsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :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. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.managed_clusters = ManagedClustersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.maintenance_configurations = MaintenanceConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( - self._client, self._config, self._serialize, self._deserialize) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.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 + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py index 11eb2ac2096b..006038a12306 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -59,7 +65,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -67,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -114,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +152,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -181,8 +177,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -196,33 +194,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -240,8 +228,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -264,15 +255,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -285,28 +281,21 @@ async def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -318,6 +307,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore async def _delete_initial( @@ -332,28 +322,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -366,6 +346,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -385,15 +367,17 @@ async def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -408,22 +392,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -435,8 +411,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -464,28 +442,18 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +467,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_available_agent_pool_versions( self, resource_group_name: str, @@ -527,27 +498,17 @@ async def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -561,8 +522,10 @@ async def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + async def _upgrade_node_image_version_initial( self, resource_group_name: str, @@ -575,28 +538,18 @@ async def _upgrade_node_image_version_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -604,18 +557,22 @@ async def _upgrade_node_image_version_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 202: response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('AgentPool', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace_async async def begin_upgrade_node_image_version( self, resource_group_name: str, @@ -637,15 +594,19 @@ async def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -660,28 +621,20 @@ async def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -693,4 +646,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py index ac26f9175e7f..d3f784c69cee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, resource_group_name: str, @@ -56,8 +62,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -65,36 +73,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -144,28 +151,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -179,8 +176,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -211,33 +211,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -251,8 +241,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -280,28 +273,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -313,3 +296,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py index 200c39b4d316..006c6668b0b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_outbound_network_dependencies_endpoints_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get_os_options( self, location: str, @@ -67,28 +73,17 @@ async def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -102,8 +97,11 @@ async def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -113,8 +111,10 @@ def list( Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -122,34 +122,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -167,11 +162,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -184,8 +181,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -193,35 +192,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -239,11 +234,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace_async async def get_upgrade_profile( self, resource_group_name: str, @@ -268,27 +265,17 @@ async def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -302,8 +289,11 @@ async def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace_async async def get_access_profile( self, resource_group_name: str, @@ -334,28 +324,18 @@ async def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -369,8 +349,11 @@ async def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_admin_credentials( self, resource_group_name: str, @@ -398,29 +381,18 @@ async def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -434,8 +406,11 @@ async def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_user_credentials( self, resource_group_name: str, @@ -463,29 +438,18 @@ async def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -499,8 +463,11 @@ async def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace_async async def list_cluster_monitoring_user_credentials( self, resource_group_name: str, @@ -528,29 +495,18 @@ async def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -564,8 +520,11 @@ async def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -590,27 +549,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -624,8 +573,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -638,32 +589,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -681,8 +622,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -702,15 +646,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -722,27 +671,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -754,6 +697,7 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _update_tags_initial( @@ -768,32 +712,22 @@ async def _update_tags_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -807,8 +741,11 @@ async def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_update_tags( self, resource_group_name: str, @@ -828,15 +765,20 @@ async def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -848,27 +790,21 @@ async def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -880,6 +816,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _delete_initial( @@ -893,27 +830,17 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -926,6 +853,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -942,15 +871,17 @@ async def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -964,21 +895,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -990,6 +914,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore async def _reset_service_principal_profile_initial( @@ -1004,32 +929,22 @@ async def _reset_service_principal_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1042,6 +957,8 @@ async def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_service_principal_profile( self, resource_group_name: str, @@ -1058,18 +975,22 @@ async def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1081,24 +1002,18 @@ async def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1110,6 +1025,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore async def _reset_aad_profile_initial( @@ -1124,32 +1040,22 @@ async def _reset_aad_profile_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1162,6 +1068,8 @@ async def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace_async async def begin_reset_aad_profile( self, resource_group_name: str, @@ -1181,15 +1089,18 @@ async def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1201,24 +1112,18 @@ async def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1230,6 +1135,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore async def _rotate_cluster_certificates_initial( @@ -1243,27 +1149,17 @@ async def _rotate_cluster_certificates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1276,6 +1172,8 @@ async def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace_async async def begin_rotate_cluster_certificates( self, resource_group_name: str, @@ -1293,15 +1191,17 @@ async def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1315,21 +1215,14 @@ async def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,6 +1234,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore async def _stop_initial( @@ -1354,27 +1248,17 @@ async def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1387,6 +1271,8 @@ async def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace_async async def begin_stop( self, resource_group_name: str, @@ -1407,15 +1293,17 @@ async def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1429,21 +1317,14 @@ async def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1455,6 +1336,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore async def _start_initial( @@ -1468,27 +1350,17 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1501,6 +1373,8 @@ async def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace_async async def begin_start( self, resource_group_name: str, @@ -1518,15 +1392,17 @@ async def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1540,21 +1416,14 @@ async def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,6 +1435,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore async def _run_command_initial( @@ -1580,32 +1450,22 @@ async def _run_command_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1621,8 +1481,11 @@ async def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async async def begin_run_command( self, resource_group_name: str, @@ -1644,15 +1507,20 @@ async def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_10_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1664,27 +1532,21 @@ async def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1696,8 +1558,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace_async async def get_command_result( self, resource_group_name: str, @@ -1725,28 +1589,18 @@ async def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -1762,15 +1616,19 @@ async def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1780,8 +1638,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1789,36 +1649,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1836,6 +1693,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py index b972813722f9..dcd50ad477bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -59,30 +66,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -100,6 +104,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py index 166cc6ccda8c..d1f161ec7990 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -67,27 +72,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -101,8 +96,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -131,28 +129,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -166,8 +154,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -198,33 +189,23 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -238,8 +219,10 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -252,28 +235,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -286,6 +259,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -305,15 +280,17 @@ async def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -328,22 +305,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -355,4 +324,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py index 1026ee633220..d180e9ebc10a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, resource_group_name: str, @@ -65,27 +70,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -99,4 +94,6 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py index 1f68df5c7724..5ad2cc2f39a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def post( self, resource_group_name: str, @@ -67,32 +72,22 @@ async def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') - # 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') + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -106,4 +101,6 @@ async def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py index 080eb8d5883e..2bbe5b368459 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools 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.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._snapshots_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -59,34 +66,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +106,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -122,7 +126,8 @@ def list_by_resource_group( :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 SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -130,35 +135,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -176,11 +177,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -205,27 +208,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -239,8 +232,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -268,32 +264,22 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Snapshot') - 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 @@ -311,8 +297,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def update_tags( self, resource_group_name: str, @@ -340,32 +329,22 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -379,8 +358,11 @@ async def update_tags( return cls(pipeline_response, deserialized, {}) return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -405,27 +387,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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 @@ -437,3 +409,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/__init__.py index 732cfd257488..641f278c0c33 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/__init__.py @@ -6,180 +6,93 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AgentPool - from ._models_py3 import AgentPoolAvailableVersions - from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models_py3 import AgentPoolListResult - from ._models_py3 import AgentPoolUpgradeProfile - from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models_py3 import AgentPoolUpgradeSettings - from ._models_py3 import CloudErrorBody - from ._models_py3 import ContainerServiceDiagnosticsProfile - from ._models_py3 import ContainerServiceLinuxProfile - from ._models_py3 import ContainerServiceMasterProfile - from ._models_py3 import ContainerServiceNetworkProfile - from ._models_py3 import ContainerServiceSshConfiguration - from ._models_py3 import ContainerServiceSshPublicKey - from ._models_py3 import ContainerServiceVMDiagnostics - from ._models_py3 import CreationData - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults - from ._models_py3 import EndpointDependency - from ._models_py3 import EndpointDetail - from ._models_py3 import ExtendedLocation - from ._models_py3 import KubeletConfig - from ._models_py3 import LinuxOSConfig - from ._models_py3 import MaintenanceConfiguration - from ._models_py3 import MaintenanceConfigurationListResult - from ._models_py3 import ManagedCluster - from ._models_py3 import ManagedClusterAADProfile - from ._models_py3 import ManagedClusterAPIServerAccessProfile - from ._models_py3 import ManagedClusterAccessProfile - from ._models_py3 import ManagedClusterAddonProfile - from ._models_py3 import ManagedClusterAddonProfileIdentity - from ._models_py3 import ManagedClusterAgentPoolProfile - from ._models_py3 import ManagedClusterAgentPoolProfileProperties - from ._models_py3 import ManagedClusterAutoUpgradeProfile - from ._models_py3 import ManagedClusterHTTPProxyConfig - from ._models_py3 import ManagedClusterIdentity - from ._models_py3 import ManagedClusterListResult - from ._models_py3 import ManagedClusterLoadBalancerProfile - from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models_py3 import ManagedClusterManagedOutboundIPProfile - from ._models_py3 import ManagedClusterNATGatewayProfile - from ._models_py3 import ManagedClusterPodIdentity - from ._models_py3 import ManagedClusterPodIdentityException - from ._models_py3 import ManagedClusterPodIdentityProfile - from ._models_py3 import ManagedClusterPodIdentityProvisioningError - from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody - from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo - from ._models_py3 import ManagedClusterPoolUpgradeProfile - from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile - from ._models_py3 import ManagedClusterSKU - from ._models_py3 import ManagedClusterSecurityProfile - from ._models_py3 import ManagedClusterSecurityProfileAzureDefender - from ._models_py3 import ManagedClusterServicePrincipalProfile - from ._models_py3 import ManagedClusterUpgradeProfile - from ._models_py3 import ManagedClusterWindowsProfile - from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue - from ._models_py3 import OSOptionProfile - from ._models_py3 import OSOptionProperty - from ._models_py3 import OperationListResult - from ._models_py3 import OperationValue - from ._models_py3 import OutboundEnvironmentEndpoint - from ._models_py3 import OutboundEnvironmentEndpointCollection - from ._models_py3 import PowerState - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionListResult - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResourcesListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import Resource - from ._models_py3 import ResourceReference - from ._models_py3 import RunCommandRequest - from ._models_py3 import RunCommandResult - from ._models_py3 import Snapshot - from ._models_py3 import SnapshotListResult - from ._models_py3 import SubResource - from ._models_py3 import SysctlConfig - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TimeInWeek - from ._models_py3 import TimeSpan - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import WindowsGmsaProfile -except (SyntaxError, ImportError): - from ._models import AgentPool # type: ignore - from ._models import AgentPoolAvailableVersions # type: ignore - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore - from ._models import AgentPoolListResult # type: ignore - from ._models import AgentPoolUpgradeProfile # type: ignore - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore - from ._models import AgentPoolUpgradeSettings # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import ContainerServiceDiagnosticsProfile # type: ignore - from ._models import ContainerServiceLinuxProfile # type: ignore - from ._models import ContainerServiceMasterProfile # type: ignore - from ._models import ContainerServiceNetworkProfile # type: ignore - from ._models import ContainerServiceSshConfiguration # type: ignore - from ._models import ContainerServiceSshPublicKey # type: ignore - from ._models import ContainerServiceVMDiagnostics # type: ignore - from ._models import CreationData # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore - from ._models import EndpointDependency # type: ignore - from ._models import EndpointDetail # type: ignore - from ._models import ExtendedLocation # type: ignore - from ._models import KubeletConfig # type: ignore - from ._models import LinuxOSConfig # type: ignore - from ._models import MaintenanceConfiguration # type: ignore - from ._models import MaintenanceConfigurationListResult # type: ignore - from ._models import ManagedCluster # type: ignore - from ._models import ManagedClusterAADProfile # type: ignore - from ._models import ManagedClusterAPIServerAccessProfile # type: ignore - from ._models import ManagedClusterAccessProfile # type: ignore - from ._models import ManagedClusterAddonProfile # type: ignore - from ._models import ManagedClusterAddonProfileIdentity # type: ignore - from ._models import ManagedClusterAgentPoolProfile # type: ignore - from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore - from ._models import ManagedClusterAutoUpgradeProfile # type: ignore - from ._models import ManagedClusterHTTPProxyConfig # type: ignore - from ._models import ManagedClusterIdentity # type: ignore - from ._models import ManagedClusterListResult # type: ignore - from ._models import ManagedClusterLoadBalancerProfile # type: ignore - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore - from ._models import ManagedClusterManagedOutboundIPProfile # type: ignore - from ._models import ManagedClusterNATGatewayProfile # type: ignore - from ._models import ManagedClusterPodIdentity # type: ignore - from ._models import ManagedClusterPodIdentityException # type: ignore - from ._models import ManagedClusterPodIdentityProfile # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore - from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore - from ._models import ManagedClusterPoolUpgradeProfile # type: ignore - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore - from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore - from ._models import ManagedClusterSKU # type: ignore - from ._models import ManagedClusterSecurityProfile # type: ignore - from ._models import ManagedClusterSecurityProfileAzureDefender # type: ignore - from ._models import ManagedClusterServicePrincipalProfile # type: ignore - from ._models import ManagedClusterUpgradeProfile # type: ignore - from ._models import ManagedClusterWindowsProfile # type: ignore - from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue # type: ignore - from ._models import OSOptionProfile # type: ignore - from ._models import OSOptionProperty # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationValue # type: ignore - from ._models import OutboundEnvironmentEndpoint # type: ignore - from ._models import OutboundEnvironmentEndpointCollection # type: ignore - from ._models import PowerState # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionListResult # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourcesListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceReference # type: ignore - from ._models import RunCommandRequest # type: ignore - from ._models import RunCommandResult # type: ignore - from ._models import Snapshot # type: ignore - from ._models import SnapshotListResult # type: ignore - from ._models import SubResource # type: ignore - from ._models import SysctlConfig # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TimeInWeek # type: ignore - from ._models import TimeSpan # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import WindowsGmsaProfile # type: ignore +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileAzureDefender +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import WindowsGmsaProfile + from ._container_service_client_enums import ( AgentPoolMode, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_container_service_client_enums.py index 28fe051084fe..feacacdf3147 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_container_service_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools @@ -39,7 +24,7 @@ class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: User agent pools are primarily for hosting your application pods. USER = "User" -class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of Agent Pool. """ @@ -48,7 +33,7 @@ class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use of this is strongly discouraged. AVAILABILITY_SET = "AvailabilitySet" -class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Tells whether the cluster is Running or Stopped """ @@ -57,7 +42,7 @@ class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The cluster is stopped. STOPPED = "Stopped" -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The private link service connection status. """ @@ -66,7 +51,7 @@ class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice of orchestrator. """ @@ -74,7 +59,7 @@ class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMet STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" -class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Size of agent VMs. Note: This is no longer maintained. """ @@ -253,7 +238,7 @@ class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" -class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. """ @@ -262,7 +247,7 @@ class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): THREE = 3 FIVE = 5 -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -271,7 +256,7 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'random'. See `expanders `_ for more information. @@ -294,13 +279,13 @@ class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Used when you don't have a particular need for the node groups to scale differently. RANDOM = "random" -class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of extendedLocation. """ EDGE_ZONE = "EdgeZone" -class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. """ @@ -310,14 +295,14 @@ class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIG4_G = "MIG4g" MIG7_G = "MIG7g" -class IpFamily(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class IpFamily(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The IP version to use for cluster networking and IP assignment. """ I_PV4 = "IPv4" I_PV6 = "IPv6" -class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. """ @@ -327,7 +312,7 @@ class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Kubelet will use the temporary disk for its data. TEMPORARY = "Temporary" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. """ @@ -337,7 +322,7 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Enables Azure Hybrid User Benefits for Windows VMs. WINDOWS_SERVER = "Windows_Server" -class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. @@ -350,7 +335,7 @@ class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use a basic Load Balancer with limited functionality. BASIC = "basic" -class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state of the pod identity. """ @@ -359,13 +344,13 @@ class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of a managed cluster SKU. """ BASIC = "Basic" -class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """If not specified, the default is 'Free'. See `uptime SLA `_ for more details. """ @@ -376,7 +361,7 @@ class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. FREE = "Free" -class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This cannot be specified if networkPlugin is anything other than 'azure'. """ @@ -387,7 +372,7 @@ class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: This is no longer supported. BRIDGE = "bridge" -class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network plugin used for building the Kubernetes network. """ @@ -400,7 +385,7 @@ class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: information. KUBENET = "kubenet" -class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Network policy used for building the Kubernetes network. """ @@ -413,7 +398,7 @@ class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: for more information. AZURE = "azure" -class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS @@ -429,14 +414,14 @@ class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: provides lower read/write latency, along with faster node scaling and cluster upgrades. EPHEMERAL = "Ephemeral" -class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies an OS SKU. This value must not be specified if OSType is Windows. """ UBUNTU = "Ubuntu" CBL_MARINER = "CBLMariner" -class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The operating system type. The default is Linux. """ @@ -445,7 +430,7 @@ class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Use Windows. WINDOWS = "Windows" -class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This can only be set at cluster creation time and cannot be changed later. For more information see `egress outbound type `_. """ @@ -465,7 +450,7 @@ class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: advanced scenario and requires proper network configuration. USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" -class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -474,14 +459,14 @@ class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitive DELETING = "Deleting" FAILED = "Failed" -class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PublicNetworkAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Allow or deny public network access for AKS """ ENABLED = "Enabled" DISABLED = "Disabled" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `use managed identities in AKS `_. """ @@ -497,7 +482,7 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. NONE = "None" -class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleDownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes how VMs are added to or removed from Agent Pools. See `billing states `_. """ @@ -508,7 +493,7 @@ class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: during scale down. DEALLOCATE = "Deallocate" -class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see `spot VMs `_ @@ -521,7 +506,7 @@ class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: cause issues with cluster scaling or upgrading. DEALLOCATE = "Deallocate" -class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Virtual Machine Scale Set priority. """ @@ -531,14 +516,14 @@ class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Regular VMs will be used. REGULAR = "Regular" -class SnapshotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SnapshotType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of a snapshot. The default is NodePool. """ #: The snapshot is a snapshot of a node pool. NODE_POOL = "NodePool" -class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """For more information see `setting the AKS cluster auto-upgrade channel `_. """ @@ -568,7 +553,7 @@ class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. NONE = "none" -class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The weekday enum. """ @@ -580,7 +565,7 @@ class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class WorkloadRuntime(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WorkloadRuntime(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines the type of workload a node can run. """ diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models.py deleted file mode 100644 index ef3507dbfdb8..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models.py +++ /dev/null @@ -1,3924 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :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(SubResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: - "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or - ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool - can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and - does not accrue billing charges. An Agent Pool can only be stopped if it is Running and - provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, - 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, - 'min_count': {'key': 'properties.minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, - 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, - 'mode': {'key': 'properties.mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'properties.tags', 'type': '{str}'}, - 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.workload_runtime = kwargs.get('workload_runtime', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type_properties_type = kwargs.get('type_properties_type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = kwargs.get('power_state', None) - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - self.creation_data = kwargs.get('creation_data', None) - - -class AgentPoolAvailableVersions(msrest.serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the agent pool version list. - :vartype id: str - :ivar name: The name of the agent pool version list. - :vartype name: str - :ivar type: Type of the agent pool version list. - :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: - list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - - _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'}, - 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersions, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.agent_pool_versions = kwargs.get('agent_pool_versions', None) - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'default': {'key': 'default', 'type': 'bool'}, - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) - self.default = kwargs.get('default', None) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolListResult(msrest.serialization.Model): - """The response from the List Agent Pools operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AgentPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class AgentPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for an agent pool. - - Variables are only 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 ID of the agent pool upgrade profile. - :vartype id: str - :ivar name: The name of the agent pool upgrade profile. - :vartype name: str - :ivar type: The type of the agent pool upgrade profile. - :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, - 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kubernetes_version = kwargs['kubernetes_version'] - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - self.latest_node_image_version = kwargs.get('latest_node_image_version', None) - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class AgentPoolUpgradeSettings(msrest.serialization.Model): - """Settings for upgrading an agentpool. - - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). - If a percentage is specified, it is the percentage of the total agent pool size at the time of - the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is - 1. For more information, including best practices, see: - https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str - """ - - _attribute_map = { - 'max_surge': {'key': 'maxSurge', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentPoolUpgradeSettings, self).__init__(**kwargs) - self.max_surge = kwargs.get('max_surge', None) - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Container 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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_10_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', '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.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): - """Profile for diagnostics on the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: - ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceVMDiagnostics - """ - - _validation = { - 'vm_diagnostics': {'required': True}, - } - - _attribute_map = { - 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs['vm_diagnostics'] - - -class ContainerServiceLinuxProfile(msrest.serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshConfiguration - """ - - _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.ssh = kwargs['ssh'] - - -class ContainerServiceMasterProfile(msrest.serialization.Model): - """Profile for the container service master. - - Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_10_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", - "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", - "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", - "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", - "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", - "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", - "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", - "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", - "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", - "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", - "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", - "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", - "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", - "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", - "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", - "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", - "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", - "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", - "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", - "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", - "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", - "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", - "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", - "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", - "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", - "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", - "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", - "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", - "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", - "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", - "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", - "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", - "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", - "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", - "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", - "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", - "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", - "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from - StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the - orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceStorageProfileTypes - :ivar fqdn: FQDN for the master pool. - :vartype fqdn: str - """ - - _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', "1") - self.dns_prefix = kwargs['dns_prefix'] - self.vm_size = kwargs['vm_size'] - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") - self.storage_profile = kwargs.get('storage_profile', None) - self.fqdn = None - - -class ContainerServiceNetworkProfile(msrest.serialization.Model): - """Profile of network configuration. - - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values - include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values - include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. - Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It - must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type - `_. Possible values include: - "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default - value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs - `_ for more information about the - differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterNATGatewayProfile - :param pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for - each IP family (IPv4/IPv6), is expected for dual-stack networking. - :type pod_cidrs: list[str] - :param service_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for - each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with - any Subnet IP ranges. - :type service_cidrs: list[str] - :param ip_families: IP families are used to determine single-stack or dual-stack clusters. For - single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and - IPv6. - :type ip_families: list[str or ~azure.mgmt.containerservice.v2021_10_01.models.IpFamily] - """ - - _validation = { - 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - } - - _attribute_map = { - 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, - 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, - 'network_mode': {'key': 'networkMode', 'type': 'str'}, - 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, - 'outbound_type': {'key': 'outboundType', 'type': 'str'}, - 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, - 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, - 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, - 'pod_cidrs': {'key': 'podCidrs', 'type': '[str]'}, - 'service_cidrs': {'key': 'serviceCidrs', 'type': '[str]'}, - 'ip_families': {'key': 'ipFamilies', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceNetworkProfile, self).__init__(**kwargs) - self.network_plugin = kwargs.get('network_plugin', "kubenet") - self.network_policy = kwargs.get('network_policy', None) - self.network_mode = kwargs.get('network_mode', None) - self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") - self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") - self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") - self.outbound_type = kwargs.get('outbound_type', "loadBalancer") - self.load_balancer_sku = kwargs.get('load_balancer_sku', None) - self.load_balancer_profile = kwargs.get('load_balancer_profile', None) - self.nat_gateway_profile = kwargs.get('nat_gateway_profile', None) - self.pod_cidrs = kwargs.get('pod_cidrs', None) - self.service_cidrs = kwargs.get('service_cidrs', None) - self.ip_families = kwargs.get('ip_families', None) - - -class ContainerServiceSshConfiguration(msrest.serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to Azure. - - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based - VMs. A maximum of 1 key may be specified. - :type public_keys: - list[~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshPublicKey] - """ - - _validation = { - 'public_keys': {'required': True}, - } - - _attribute_map = { - 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs['public_keys'] - - -class ContainerServiceSshPublicKey(msrest.serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to Azure. - - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str - """ - - _validation = { - 'key_data': {'required': True}, - } - - _attribute_map = { - 'key_data': {'key': 'keyData', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs['key_data'] - - -class ContainerServiceVMDiagnostics(msrest.serialization.Model): - """Profile for diagnostics on the container service VMs. - - Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool - :ivar storage_uri: The URI of the storage account where diagnostics are stored. - :vartype storage_uri: str - """ - - _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.storage_uri = None - - -class CreationData(msrest.serialization.Model): - """Data used when creating a target resource from a source resource. - - :param source_resource_id: This is the ARM ID of the source object to be used to create the - target object. - :type source_resource_id: str - """ - - _attribute_map = { - 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreationData, self).__init__(**kwargs) - self.source_resource_id = kwargs.get('source_resource_id', None) - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_10_01.models.CredentialResult] - """ - - _validation = { - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.kubeconfigs = None - - -class EndpointDependency(msrest.serialization.Model): - """A domain name that AKS agent nodes are reaching at. - - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDetail] - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDependency, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) - - -class EndpointDetail(msrest.serialization.Model): - """connect information from the AKS agent nodes to a single endpoint. - - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str - """ - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointDetail, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - self.port = kwargs.get('port', None) - self.protocol = kwargs.get('protocol', None) - self.description = kwargs.get('description', None) - - -class ExtendedLocation(msrest.serialization.Model): - """The complex type of the extended location. - - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocationTypes - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtendedLocation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class KubeletConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies - `_ - for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal - numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported - units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is - 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default - is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager - `_. The default is - 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it - is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present - for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int - """ - - _validation = { - 'container_log_max_files': {'minimum': 2}, - } - - _attribute_map = { - 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, - 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, - 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, - 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, - 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, - 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, - 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, - 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, - 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, - 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, - 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KubeletConfig, self).__init__(**kwargs) - self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) - self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) - self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) - self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) - self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) - self.topology_manager_policy = kwargs.get('topology_manager_policy', None) - self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) - self.fail_swap_on = kwargs.get('fail_swap_on', None) - self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) - self.container_log_max_files = kwargs.get('container_log_max_files', None) - self.pod_max_pids = kwargs.get('pod_max_pids', None) - - -class LinuxOSConfig(msrest.serialization.Model): - """See `AKS custom node configuration `_ for more details. - - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_10_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The - default is 'always'. For more information see `Transparent Hugepages - `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', - 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent - Hugepages - `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int - """ - - _attribute_map = { - 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, - 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, - 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, - 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LinuxOSConfig, self).__init__(**kwargs) - self.sysctls = kwargs.get('sysctls', None) - self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) - self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) - self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) - - -class MaintenanceConfiguration(SubResource): - """See `planned maintenance `_ for more information about planned maintenance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.v2021_10_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied - configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeSpan] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, - 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfiguration, self).__init__(**kwargs) - self.system_data = None - self.time_in_week = kwargs.get('time_in_week', None) - self.not_allowed_time = kwargs.get('not_allowed_time', None) - - -class MaintenanceConfigurationListResult(msrest.serialization.Model): - """The response from the List maintenance configurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MaintenanceConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ManagedCluster(Resource): - """Managed cluster. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterIdentity - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions - cannot be skipped. All upgrades must be performed sequentially by major version number. For - example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> - 1.16.x is not allowed. See `upgrading an AKS cluster - `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str - :ivar fqdn: The FQDN of the master pool. - :vartype fqdn: str - :ivar private_fqdn: The FQDN of private cluster. - :vartype private_fqdn: str - :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) - headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. - This special FQDN supports CORS, allowing the Azure Portal to function properly. - :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity - `_ for more details on AAD pod - identity integration. - :type pod_identity_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security - policy (preview). This feature is set for removal on October 15th, 2020. Learn more at - aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, - ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: - list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for - this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details - see `disable local accounts - `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSecurityProfile - :param public_network_access: Allow or deny public network access for AKS. Possible values - include: "Enabled", "Disabled". - :type public_network_access: str or - ~azure.mgmt.containerservice.v2021_10_01.models.PublicNetworkAccess - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'power_state': {'readonly': True}, - 'max_agent_pools': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'private_fqdn': {'readonly': True}, - 'azure_portal_fqdn': {'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': 'ManagedClusterSKU'}, - 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, - 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, - 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, - 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, - 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, - 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, - 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, - 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, - 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, - 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, - 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, - 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, - 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, - 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, - 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, - 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, - 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, - 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, - 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, - 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, - 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, - 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedCluster, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.extended_location = kwargs.get('extended_location', None) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.power_state = None - self.max_agent_pools = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) - self.fqdn = None - self.private_fqdn = None - self.azure_portal_fqdn = None - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) - self.linux_profile = kwargs.get('linux_profile', None) - self.windows_profile = kwargs.get('windows_profile', None) - self.service_principal_profile = kwargs.get('service_principal_profile', None) - self.addon_profiles = kwargs.get('addon_profiles', None) - self.pod_identity_profile = kwargs.get('pod_identity_profile', None) - self.node_resource_group = kwargs.get('node_resource_group', None) - self.enable_rbac = kwargs.get('enable_rbac', None) - self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) - self.network_profile = kwargs.get('network_profile', None) - self.aad_profile = kwargs.get('aad_profile', None) - self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) - self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) - self.api_server_access_profile = kwargs.get('api_server_access_profile', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.identity_profile = kwargs.get('identity_profile', None) - self.private_link_resources = kwargs.get('private_link_resources', None) - self.disable_local_accounts = kwargs.get('disable_local_accounts', None) - self.http_proxy_config = kwargs.get('http_proxy_config', None) - self.security_profile = kwargs.get('security_profile', None) - self.public_network_access = kwargs.get('public_network_access', None) - - -class ManagedClusterAADProfile(msrest.serialization.Model): - """For more details see `managed AAD on AKS `_. - - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :type tenant_id: str - """ - - _attribute_map = { - 'managed': {'key': 'managed', 'type': 'bool'}, - 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, - 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, - 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, - 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.managed = kwargs.get('managed', None) - self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) - self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) - self.server_app_secret = kwargs.get('server_app_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) - - -class ManagedClusterAccessProfile(Resource): - """Managed cluster Access Profile. - - Variables are only 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAccessProfile, self).__init__(**kwargs) - self.kube_config = kwargs.get('kube_config', None) - - -class ManagedClusterAddonProfile(msrest.serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only 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 enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.config = kwargs.get('config', None) - self.identity = None - - -class UserAssignedIdentity(msrest.serialization.Model): - """Details about a user assigned identity. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserAssignedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) - - -class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool - can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and - does not accrue billing charges. An Agent Pool can only be stopped if it is Running and - provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) - self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.os_disk_type = kwargs.get('os_disk_type', None) - self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) - self.workload_runtime = kwargs.get('workload_runtime', None) - self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) - self.pod_subnet_id = kwargs.get('pod_subnet_id', None) - self.max_pods = kwargs.get('max_pods', None) - self.os_type = kwargs.get('os_type', "Linux") - self.os_sku = kwargs.get('os_sku', None) - self.max_count = kwargs.get('max_count', None) - self.min_count = kwargs.get('min_count', None) - self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) - self.scale_down_mode = kwargs.get('scale_down_mode', None) - self.type = kwargs.get('type', None) - self.mode = kwargs.get('mode', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) - self.node_image_version = None - self.upgrade_settings = kwargs.get('upgrade_settings', None) - self.provisioning_state = None - self.power_state = kwargs.get('power_state', None) - self.availability_zones = kwargs.get('availability_zones', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) - self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) - self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") - self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") - self.spot_max_price = kwargs.get('spot_max_price', -1) - self.tags = kwargs.get('tags', None) - self.node_labels = kwargs.get('node_labels', None) - self.node_taints = kwargs.get('node_taints', None) - self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) - self.kubelet_config = kwargs.get('kubelet_config', None) - self.linux_os_config = kwargs.get('linux_os_config', None) - self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) - self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) - self.enable_fips = kwargs.get('enable_fips', None) - self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) - self.creation_data = kwargs.get('creation_data', None) - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute - resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted - VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk - larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed - after creation. For more information see `Ephemeral OS - `_. Possible values - include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data - root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values - include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. - If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just - nodes. This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see - vnetSubnetID for more details). This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it - defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", - "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional - information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", - "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS - cluster to the same Kubernetes version. The node pool version must have the same major version - as the control plane. The node pool minor version must be within two minor versions of the - control plane version. The node pool version cannot be greater than the control plane version. - For more information see `upgrading a node pool - `_. - :type orchestrator_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: - ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool - can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and - does not accrue billing charges. An Agent Pool can only be stopped if it is Running and - provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be - specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their - own dedicated public IP addresses. A common scenario is for gaming workloads, where a console - needs to make a direct connection to a cloud virtual machine to minimize hops. For more - information see `assigning a public IP per node - `_. - The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is - 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", - "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale - set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain - Azure regions. For more information, see: - https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool - `_ - for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile - for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or - ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str - """ - - _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, - 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, - 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, - 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, - 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, - 'max_pods': {'key': 'maxPods', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_sku': {'key': 'osSKU', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'min_count': {'key': 'minCount', 'type': 'int'}, - 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, - 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, - 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, - 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'power_state': {'key': 'powerState', 'type': 'PowerState'}, - 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, - 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, - 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, - 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, - 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, - 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, - 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, - 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, - 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, - 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, - 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, - 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, - 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, - 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - - -class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): - """Access profile for managed cluster API server. - - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. - This feature is not compatible with clusters that use Public IP Per Node, or clusters that are - using a Basic Load Balancer. For more information see `API server authorized IP ranges - `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster - `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private - cluster or not. - :type enable_private_cluster_public_fqdn: bool - :param disable_run_command: Whether to disable run command for the cluster or not. - :type disable_run_command: bool - """ - - _attribute_map = { - 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, - 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, - 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, - 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, - 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) - self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) - self.enable_private_cluster = kwargs.get('enable_private_cluster', None) - self.private_dns_zone = kwargs.get('private_dns_zone', None) - self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) - self.disable_run_command = kwargs.get('disable_run_command', None) - - -class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): - """Auto upgrade profile for a managed cluster. - - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel - `_. Possible - values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_10_01.models.UpgradeChannel - """ - - _attribute_map = { - 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) - self.upgrade_channel = kwargs.get('upgrade_channel', None) - - -class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): - """Cluster HTTP proxy configuration. - - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str - """ - - _attribute_map = { - 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, - 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, - 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, - 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) - self.http_proxy = kwargs.get('http_proxy', None) - self.https_proxy = kwargs.get('https_proxy', None) - self.no_proxy = kwargs.get('no_proxy', None) - self.trusted_ca = kwargs.get('trusted_ca', None) - - -class ManagedClusterIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by master - components. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by master - components. - :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS - `_. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedClusterListResult(msrest.serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedCluster]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): - """Profile of the managed cluster load balancer. - - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load - balancer. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed - values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in - Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS - cluster or not. - :type enable_multiple_standard_load_balancers: bool - """ - - _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, - 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) - self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_i_ps = kwargs.get('outbound_i_ps', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) - self.enable_multiple_standard_load_balancers = kwargs.get('enable_multiple_standard_load_balancers', None) - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): - """Desired managed outbound IPs for the cluster load balancer. - - :param count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster - load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value - is 1. - :type count: int - :param count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the - cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default - value is 0 for single-stack and 1 for dual-stack. - :type count_ipv6: int - """ - - _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - 'count_ipv6': {'maximum': 100, 'minimum': 0}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - 'count_ipv6': {'key': 'countIPv6', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.count_ipv6 = kwargs.get('count_ipv6', 0) - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): - """Desired outbound IP Prefix resources for the cluster load balancer. - - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: - list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) - self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) - - -class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): - """Desired outbound IP resources for the cluster load balancer. - - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] - """ - - _attribute_map = { - 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_i_ps = kwargs.get('public_i_ps', None) - - -class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): - """Profile of the managed outbound IP resources of the managed cluster. - - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must - be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int - """ - - _validation = { - 'count': {'maximum': 16, 'minimum': 1}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - - -class ManagedClusterNATGatewayProfile(msrest.serialization.Model): - """Profile of the managed cluster NAT gateway. - - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster - NAT gateway. - :type managed_outbound_ip_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: - list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int - """ - - _validation = { - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, - } - - _attribute_map = { - 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, - 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) - self.managed_outbound_ip_profile = kwargs.get('managed_outbound_ip_profile', None) - self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 4) - - -class ManagedClusterPodIdentity(msrest.serialization.Model): - """Details about the pod identity assigned to the Managed Cluster. - - Variables are only 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 name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Possible values - include: "Assigned", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.binding_selector = kwargs.get('binding_selector', None) - self.identity = kwargs['identity'] - self.provisioning_state = None - self.provisioning_info = None - - -class ManagedClusterPodIdentityException(msrest.serialization.Model): - """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] - """ - - _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityException, self).__init__(**kwargs) - self.name = kwargs['name'] - self.namespace = kwargs['namespace'] - self.pod_labels = kwargs['pod_labels'] - - -class ManagedClusterPodIdentityProfile(msrest.serialization.Model): - """See `use AAD pod identity `_ for more details on pod identity integration. - - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the - security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet - network plugin with AAD Pod Identity - `_ - for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: - list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, - 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) - - -class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): - """An error response from the pod identity provisioning. - - :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 target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: - list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): - """ManagedClusterPodIdentityProvisioningInfo. - - :param error: Pod identity assignment error (if any). - :type error: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to Azure. - - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values - include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: - list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - """ - - _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, - } - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs['kubernetes_version'] - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', "Linux") - self.upgrades = kwargs.get('upgrades', None) - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool - """ - - _attribute_map = { - 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, - 'is_preview': {'key': 'isPreview', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) - self.is_preview = kwargs.get('is_preview', None) - - -class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): - """Parameters to be applied to the cluster-autoscaler when enabled. - - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders - `_ - for more information. Possible values include: "least-waste", "most-pods", "priority", - "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_10_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to - act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore - unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer - followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by - an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an - integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed - by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an - 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str - """ - - _attribute_map = { - 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, - 'expander': {'key': 'expander', 'type': 'str'}, - 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, - 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, - 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, - 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, - 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, - 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, - 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, - 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, - 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, - 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, - 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, - 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, - 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, - 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, - 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) - self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) - self.expander = kwargs.get('expander', None) - self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) - self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) - self.max_node_provision_time = kwargs.get('max_node_provision_time', None) - self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) - self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) - self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) - self.scan_interval = kwargs.get('scan_interval', None) - self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) - self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) - self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) - self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) - self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) - self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) - self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) - self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) - - -class ManagedClusterSecurityProfile(msrest.serialization.Model): - """Security profile for the container service cluster. - - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSecurityProfileAzureDefender - """ - - _attribute_map = { - 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfile, self).__init__(**kwargs) - self.azure_defender = kwargs.get('azure_defender', None) - - -class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): - """Azure Defender settings for the security profile. - - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be - associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.log_analytics_workspace_resource_id = kwargs.get('log_analytics_workspace_resource_id', None) - - -class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure APIs. - - All required parameters must be populated in order to send to Azure. - - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str - """ - - _validation = { - 'client_id': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.secret = kwargs.get('secret', None) - - -class ManagedClusterSKU(msrest.serialization.Model): - """The SKU of a Managed Cluster. - - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA - `_ for more details. Possible values include: - "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUTier - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterSKU, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - - -class ManagedClusterUpgradeProfile(msrest.serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only 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 ID of the upgrade profile. - :vartype id: str - :ivar name: The name of the upgrade profile. - :vartype name: str - :ivar type: The type of the upgrade profile. - :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control - plane. - :type control_plane_profile: - ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: - list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, - 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.control_plane_profile = kwargs['control_plane_profile'] - self.agent_pool_profiles = kwargs['agent_pool_profiles'] - - -class ManagedClusterWindowsProfile(msrest.serialization.Model): - """Profile for Windows VMs in the managed cluster. - - All required parameters must be populated in order to send to Azure. - - :param admin_username: Required. Specifies the name of the administrator account. - :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` - **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", - "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", - "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", - "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 - character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. - :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` - **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 - conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) - :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Possible values - include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo - `_. - :type enable_csi_proxy: bool - :param gmsa_profile: The Windows gMSA Profile in the Managed Cluster. - :type gmsa_profile: ~azure.mgmt.containerservice.v2021_10_01.models.WindowsGmsaProfile - """ - - _validation = { - 'admin_username': {'required': True}, - } - - _attribute_map = { - 'admin_username': {'key': 'adminUsername', 'type': 'str'}, - 'admin_password': {'key': 'adminPassword', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, - 'gmsa_profile': {'key': 'gmsaProfile', 'type': 'WindowsGmsaProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs['admin_username'] - self.admin_password = kwargs.get('admin_password', None) - self.license_type = kwargs.get('license_type', None) - self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) - self.gmsa_profile = kwargs.get('gmsa_profile', None) - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class OperationListResult(msrest.serialization.Model): - """The List Operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.OperationValue] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - - -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the operation. - :vartype origin: str - :ivar name: The name of the operation. - :vartype name: str - :ivar operation: The display name of the operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSOptionProfile(msrest.serialization.Model): - """The OS option profile. - - Variables are only 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 ID of the OS option resource. - :vartype id: str - :ivar name: The name of the OS option resource. - :vartype name: str - :ivar type: The type of the OS option resource. - :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: - list[~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProperty] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProfile, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.os_option_property_list = kwargs['os_option_property_list'] - - -class OSOptionProperty(msrest.serialization.Model): - """OS option property. - - All required parameters must be populated in order to send to Azure. - - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool - """ - - _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, - } - - _attribute_map = { - 'os_type': {'key': 'os-type', 'type': 'str'}, - 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OSOptionProperty, self).__init__(**kwargs) - self.os_type = kwargs['os_type'] - self.enable_fips_image = kwargs['enable_fips_image'] - - -class OutboundEnvironmentEndpoint(msrest.serialization.Model): - """Egress endpoints which AKS agent nodes connect to for common purpose. - - :param category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDependency] - """ - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) - - -class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): - """Collection of OutboundEnvironmentEndpoint. - - Variables are only 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 value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = None - - -class PowerState(msrest.serialization.Model): - """Describes the Power State of the cluster. - - :param code: Tells whether the cluster is Running or Stopped. Possible values include: - "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_10_01.models.Code - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PowerState, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """Private endpoint which a connection belongs to. - - :param id: The resource ID of the private endpoint. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class PrivateEndpointConnection(msrest.serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", - "Creating", "Deleting", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: - ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.provisioning_state = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - - -class PrivateEndpointConnectionListResult(msrest.serialization.Model): - """A list of private endpoint connections. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkResource(msrest.serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - 'private_link_service_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, - 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.group_id = kwargs.get('group_id', None) - self.required_members = kwargs.get('required_members', None) - self.private_link_service_id = None - - -class PrivateLinkResourcesListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourcesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """The state of a private link service connection. - - :param status: The private link service connection status. Possible values include: "Pending", - "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_10_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - - -class ResourceReference(msrest.serialization.Model): - """A reference to an Azure resource. - - :param id: The fully qualified Azure resource id. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class RunCommandRequest(msrest.serialization.Model): - """A run command request. - - All required parameters must be populated in order to send to Azure. - - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str - """ - - _validation = { - 'command': {'required': True}, - } - - _attribute_map = { - 'command': {'key': 'command', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandRequest, self).__init__(**kwargs) - self.command = kwargs['command'] - self.context = kwargs.get('context', None) - self.cluster_token = kwargs.get('cluster_token', None) - - -class RunCommandResult(msrest.serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: The exit code of the command. - :vartype exit_code: int - :ivar started_at: The time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: The time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: The command output. - :vartype logs: str - :ivar reason: An explanation of why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - 'id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'exit_code': {'readonly': True}, - 'started_at': {'readonly': True}, - 'finished_at': {'readonly': True}, - 'logs': {'readonly': True}, - 'reason': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, - 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, - 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, - 'logs': {'key': 'properties.logs', 'type': 'str'}, - 'reason': {'key': 'properties.reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunCommandResult, self).__init__(**kwargs) - self.id = None - self.provisioning_state = None - self.exit_code = None - self.started_at = None - self.finished_at = None - self.logs = None - self.reason = None - - -class Snapshot(Resource): - """A node pool snapshot 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. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar system_data: The system metadata relating to this snapshot. - :vartype system_data: ~azure.mgmt.containerservice.v2021_10_01.models.SystemData - :param creation_data: CreationData to be used to specify the source agent pool resource ID to - create this snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData - :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: - "NodePool". Default value: "NodePool". - :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.SnapshotType - :ivar kubernetes_version: The version of Kubernetes. - :vartype kubernetes_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :ivar os_type: The operating system type. The default is Linux. Possible values include: - "Linux", "Windows". Default value: "Linux". - :vartype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. - Possible values include: "Ubuntu", "CBLMariner". - :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :ivar vm_size: The size of the VM. - :vartype vm_size: str - :ivar enable_fips: Whether to use a FIPS-enabled OS. - :vartype enable_fips: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'kubernetes_version': {'readonly': True}, - 'node_image_version': {'readonly': True}, - 'os_type': {'readonly': True}, - 'os_sku': {'readonly': True}, - 'vm_size': {'readonly': True}, - 'enable_fips': {'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}'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, - 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, - 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, - 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, - 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, - 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(Snapshot, self).__init__(**kwargs) - self.system_data = None - self.creation_data = kwargs.get('creation_data', None) - self.snapshot_type = kwargs.get('snapshot_type', "NodePool") - self.kubernetes_version = None - self.node_image_version = None - self.os_type = None - self.os_sku = None - self.vm_size = None - self.enable_fips = None - - -class SnapshotListResult(msrest.serialization.Model): - """The response from the List Snapshots operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: The list of snapshots. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.Snapshot] - :ivar next_link: The URL to get the next set of snapshot results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Snapshot]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SnapshotListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class SysctlConfig(msrest.serialization.Model): - """Sysctl settings for Linux agent nodes. - - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int - """ - - _attribute_map = { - 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, - 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, - 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, - 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, - 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, - 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, - 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, - 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, - 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, - 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, - 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, - 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, - 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, - 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, - 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, - 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, - 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, - 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, - 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, - 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, - 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, - 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, - 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, - 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, - 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, - 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SysctlConfig, self).__init__(**kwargs) - self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) - self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) - self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) - self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) - self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) - self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) - self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) - self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) - self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) - self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) - self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) - self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) - self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) - self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) - self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) - self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) - self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) - self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) - self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) - self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) - self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) - self.fs_file_max = kwargs.get('fs_file_max', None) - self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) - self.fs_nr_open = kwargs.get('fs_nr_open', None) - self.kernel_threads_max = kwargs.get('kernel_threads_max', None) - self.vm_max_map_count = kwargs.get('vm_max_map_count', None) - self.vm_swappiness = kwargs.get('vm_swappiness', None) - self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', 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.containerservice.v2021_10_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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.containerservice.v2021_10_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 TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class TimeInWeek(msrest.serialization.Model): - """Time in a week. - - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_10_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour - ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 - UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] - """ - - _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeInWeek, self).__init__(**kwargs) - self.day = kwargs.get('day', None) - self.hour_slots = kwargs.get('hour_slots', None) - - -class TimeSpan(msrest.serialization.Model): - """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime - """ - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(TimeSpan, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) - - -class WindowsGmsaProfile(msrest.serialization.Model): - """Windows gMSA Profile in the managed cluster. - - :param enabled: Specifies whether to enable Windows gMSA in the managed cluster. - :type enabled: bool - :param dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it - to empty if you have configured the DNS server in the vnet which is used to create the managed - cluster. - :type dns_server: str - :param root_domain_name: Specifies the root domain name for Windows gMSA. - :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet - which is used to create the managed cluster. - :type root_domain_name: str - """ - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'dns_server': {'key': 'dnsServer', 'type': 'str'}, - 'root_domain_name': {'key': 'rootDomainName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WindowsGmsaProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.dns_server = kwargs.get('dns_server', None) - self.root_domain_name = kwargs.get('root_domain_name', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py index 66a8fb93022d..74436df3af1d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py @@ -44,6 +44,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -62,141 +64,143 @@ class AgentPool(SubResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode - :param type_properties_type: The type of Agent Pool. Possible values include: + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode + :ivar type_properties_type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type_properties_type: str or + :vartype type_properties_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :vartype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData """ _validation = { @@ -295,6 +299,143 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode + :keyword type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + """ super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -348,8 +489,8 @@ class AgentPoolAvailableVersions(msrest.serialization.Model): :vartype name: str :ivar type: Type of the agent pool version list. :vartype type: str - :param agent_pool_versions: List of versions available for agent pool. - :type agent_pool_versions: + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] """ @@ -372,6 +513,11 @@ def __init__( agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, **kwargs ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -382,12 +528,12 @@ def __init__( class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - :param default: Whether this version is the default agent pool version. - :type default: bool - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether Kubernetes version is currently in preview. - :type is_preview: bool + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -404,6 +550,14 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version @@ -415,8 +569,8 @@ class AgentPoolListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of agent pools. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] :ivar next_link: The URL to get the next set of agent pool results. :vartype next_link: str """ @@ -436,6 +590,10 @@ def __init__( value: Optional[List["AgentPool"]] = None, **kwargs ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] + """ super(AgentPoolListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -454,16 +612,16 @@ class AgentPoolUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the agent pool upgrade profile. :vartype type: str - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :param latest_node_image_version: The latest AKS supported node image version. - :type latest_node_image_version: str + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str """ _validation = { @@ -493,6 +651,18 @@ def __init__( latest_node_image_version: Optional[str] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: The latest AKS supported node image version. + :paramtype latest_node_image_version: str + """ super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -506,10 +676,10 @@ def __init__( class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -524,6 +694,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -532,12 +708,12 @@ def __init__( class AgentPoolUpgradeSettings(msrest.serialization.Model): """Settings for upgrading an agentpool. - :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - :type max_surge: str + :vartype max_surge: str """ _attribute_map = { @@ -550,6 +726,14 @@ def __init__( max_surge: Optional[str] = None, **kwargs ): + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: str + """ super(AgentPoolUpgradeSettings, self).__init__(**kwargs) self.max_surge = max_surge @@ -557,17 +741,17 @@ def __init__( class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.containerservice.v2021_10_01.models.CloudErrorBody] + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_10_01.models.CloudErrorBody] """ _attribute_map = { @@ -586,6 +770,19 @@ def __init__( details: Optional[List["CloudErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: list[~azure.mgmt.containerservice.v2021_10_01.models.CloudErrorBody] + """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -598,8 +795,8 @@ class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. - :type vm_diagnostics: + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceVMDiagnostics """ @@ -617,6 +814,11 @@ def __init__( vm_diagnostics: "ContainerServiceVMDiagnostics", **kwargs ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceVMDiagnostics + """ super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics @@ -626,10 +828,10 @@ class ContainerServiceLinuxProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. The administrator username to use for Linux VMs. - :type admin_username: str - :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. - :type ssh: ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshConfiguration + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -649,6 +851,13 @@ def __init__( ssh: "ContainerServiceSshConfiguration", **kwargs ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshConfiguration + """ super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh @@ -661,12 +870,12 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, - 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". - :type count: str or ~azure.mgmt.containerservice.v2021_10_01.models.Count - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. - :type dns_prefix: str - :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_10_01.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", @@ -704,21 +913,21 @@ class ContainerServiceMasterProfile(msrest.serialization.Model): "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". - :type vm_size: str or + :vartype vm_size: str or ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceVMSizeTypes - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in this master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. - :type vnet_subnet_id: str - :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static - ip of masters. - :type first_consecutive_static_ip: str - :param storage_profile: Storage profile specifies what kind of storage used. Choose from + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". - :type storage_profile: str or + :vartype storage_profile: str or ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceStorageProfileTypes :ivar fqdn: FQDN for the master pool. :vartype fqdn: str @@ -747,13 +956,74 @@ def __init__( *, dns_prefix: str, vm_size: Union[str, "ContainerServiceVMSizeTypes"], - count: Optional[Union[int, "Count"]] = "1", + count: Optional[Union[int, "Count"]] = 1, os_disk_size_gb: Optional[int] = None, vnet_subnet_id: Optional[str] = None, first_consecutive_static_ip: Optional[str] = "10.240.255.5", storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, **kwargs ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_10_01.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceStorageProfileTypes + """ super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -768,53 +1038,54 @@ def __init__( class ContainerServiceNetworkProfile(msrest.serialization.Model): """Profile of network configuration. - :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + :ivar network_plugin: Network plugin used for building the Kubernetes network. Possible values include: "azure", "kubenet". Default value: "kubenet". - :type network_plugin: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPlugin - :param network_policy: Network policy used for building the Kubernetes network. Possible values + :vartype network_plugin: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPlugin + :ivar network_policy: Network policy used for building the Kubernetes network. Possible values include: "calico", "azure". - :type network_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPolicy - :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + :vartype network_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPolicy + :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: "transparent", "bridge". - :type network_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkMode - :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :type pod_cidr: str - :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + :vartype network_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - :type dns_service_ip: str - :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - :type docker_bridge_cidr: str - :param outbound_type: This can only be set at cluster creation time and cannot be changed - later. For more information see `egress outbound type + :vartype docker_bridge_cidr: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type `_. Possible values include: "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default value: "loadBalancer". - :type outbound_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OutboundType - :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + :vartype outbound_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OutboundType + :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the differences between load balancer SKUs. Possible values include: "standard", "basic". - :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.LoadBalancerSku - :param load_balancer_profile: Profile of the cluster load balancer. - :type load_balancer_profile: + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_10_01.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfile - :param nat_gateway_profile: Profile of the cluster NAT gateway. - :type nat_gateway_profile: + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterNATGatewayProfile - :param pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for - each IP family (IPv4/IPv6), is expected for dual-stack networking. - :type pod_cidrs: list[str] - :param service_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for + :ivar pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each + IP family (IPv4/IPv6), is expected for dual-stack networking. + :vartype pod_cidrs: list[str] + :ivar service_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. - :type service_cidrs: list[str] - :param ip_families: IP families are used to determine single-stack or dual-stack clusters. For + :vartype service_cidrs: list[str] + :ivar ip_families: IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - :type ip_families: list[str or ~azure.mgmt.containerservice.v2021_10_01.models.IpFamily] + :vartype ip_families: list[str or ~azure.mgmt.containerservice.v2021_10_01.models.IpFamily] """ _validation = { @@ -860,6 +1131,56 @@ def __init__( ip_families: Optional[List[Union[str, "IpFamily"]]] = None, **kwargs ): + """ + :keyword network_plugin: Network plugin used for building the Kubernetes network. Possible + values include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPlugin + :keyword network_policy: Network policy used for building the Kubernetes network. Possible + values include: "calico", "azure". + :paramtype network_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkPolicy + :keyword network_mode: This cannot be specified if networkPlugin is anything other than + 'azure'. Possible values include: "transparent", "bridge". + :paramtype network_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :paramtype outbound_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OutboundType + :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_10_01.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterNATGatewayProfile + :keyword pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for + each IP family (IPv4/IPv6), is expected for dual-stack networking. + :paramtype pod_cidrs: list[str] + :keyword service_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one + for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap + with any Subnet IP ranges. + :paramtype service_cidrs: list[str] + :keyword ip_families: IP families are used to determine single-stack or dual-stack clusters. + For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and + IPv6. + :paramtype ip_families: list[str or ~azure.mgmt.containerservice.v2021_10_01.models.IpFamily] + """ super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -882,9 +1203,9 @@ class ContainerServiceSshConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - :type public_keys: + :vartype public_keys: list[~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshPublicKey] """ @@ -902,6 +1223,12 @@ def __init__( public_keys: List["ContainerServiceSshPublicKey"], **kwargs ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. A maximum of 1 key may be specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceSshPublicKey] + """ super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys @@ -911,9 +1238,9 @@ class ContainerServiceSshPublicKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. - The certificate must be in PEM format with or without headers. - :type key_data: str + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str """ _validation = { @@ -930,6 +1257,11 @@ def __init__( key_data: str, **kwargs ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data @@ -941,8 +1273,8 @@ class ContainerServiceVMDiagnostics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. - :type enabled: bool + :ivar enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -963,6 +1295,10 @@ def __init__( enabled: bool, **kwargs ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None @@ -971,9 +1307,9 @@ def __init__( class CreationData(msrest.serialization.Model): """Data used when creating a target resource from a source resource. - :param source_resource_id: This is the ARM ID of the source object to be used to create the + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the target object. - :type source_resource_id: str + :vartype source_resource_id: str """ _attribute_map = { @@ -986,6 +1322,11 @@ def __init__( source_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ super(CreationData, self).__init__(**kwargs) self.source_resource_id = source_resource_id @@ -1015,6 +1356,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None @@ -1041,6 +1384,8 @@ def __init__( self, **kwargs ): + """ + """ super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None @@ -1048,10 +1393,10 @@ def __init__( class EndpointDependency(msrest.serialization.Model): """A domain name that AKS agent nodes are reaching at. - :param domain_name: The domain name of the dependency. - :type domain_name: str - :param endpoint_details: The Ports and Protocols used when connecting to domainName. - :type endpoint_details: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDetail] + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDetail] """ _attribute_map = { @@ -1066,6 +1411,13 @@ def __init__( endpoint_details: Optional[List["EndpointDetail"]] = None, **kwargs ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDetail] + """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name self.endpoint_details = endpoint_details @@ -1074,14 +1426,14 @@ def __init__( class EndpointDetail(msrest.serialization.Model): """connect information from the AKS agent nodes to a single endpoint. - :param ip_address: An IP Address that Domain Name currently resolves to. - :type ip_address: str - :param port: The port an endpoint is connected to. - :type port: int - :param protocol: The protocol used for connection. - :type protocol: str - :param description: Description of the detail. - :type description: str + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str """ _attribute_map = { @@ -1100,6 +1452,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ super(EndpointDetail, self).__init__(**kwargs) self.ip_address = ip_address self.port = port @@ -1110,10 +1472,10 @@ def __init__( class ExtendedLocation(msrest.serialization.Model): """The complex type of the extended location. - :param name: The name of the extended location. - :type name: str - :param type: The type of the extended location. Possible values include: "EdgeZone". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocationTypes + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocationTypes """ _attribute_map = { @@ -1128,6 +1490,12 @@ def __init__( type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocationTypes + """ super(ExtendedLocation, self).__init__(**kwargs) self.name = name self.type = type @@ -1136,40 +1504,40 @@ def __init__( class KubeletConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies `_ for more information. Allowed values are 'none' and 'static'. - :type cpu_manager_policy: str - :param cpu_cfs_quota: The default is true. - :type cpu_cfs_quota: bool - :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - :type cpu_cfs_quota_period: str - :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is 85%. - :type image_gc_high_threshold: int - :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default is 80%. - :type image_gc_low_threshold: int - :param topology_manager_policy: For more information see `Kubernetes Topology Manager + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager `_. The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - :type topology_manager_policy: str - :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in ``*``\ ). - :type allowed_unsafe_sysctls: list[str] - :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled - on the node. - :type fail_swap_on: bool - :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it is rotated. - :type container_log_max_size_mb: int - :param container_log_max_files: The maximum number of container log files that can be present + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present for a container. The number must be ≥ 2. - :type container_log_max_files: int - :param pod_max_pids: The maximum number of processes per pod. - :type pod_max_pids: int + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int """ _validation = { @@ -1206,6 +1574,42 @@ def __init__( pod_max_pids: Optional[int] = None, **kwargs ): + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ super(KubeletConfig, self).__init__(**kwargs) self.cpu_manager_policy = cpu_manager_policy self.cpu_cfs_quota = cpu_cfs_quota @@ -1223,19 +1627,19 @@ def __init__( class LinuxOSConfig(msrest.serialization.Model): """See `AKS custom node configuration `_ for more details. - :param sysctls: Sysctl settings for Linux agent nodes. - :type sysctls: ~azure.mgmt.containerservice.v2021_10_01.models.SysctlConfig - :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_10_01.models.SysctlConfig + :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_enabled: str - :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent Hugepages `_. - :type transparent_huge_page_defrag: str - :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :type swap_file_size_mb: int + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int """ _attribute_map = { @@ -1254,6 +1658,21 @@ def __init__( swap_file_size_mb: Optional[int] = None, **kwargs ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_10_01.models.SysctlConfig + :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ super(LinuxOSConfig, self).__init__(**kwargs) self.sysctls = sysctls self.transparent_huge_page_enabled = transparent_huge_page_enabled @@ -1275,11 +1694,11 @@ class MaintenanceConfiguration(SubResource): :vartype type: str :ivar system_data: The system metadata relating to this resource. :vartype system_data: ~azure.mgmt.containerservice.v2021_10_01.models.SystemData - :param time_in_week: If two array entries specify the same day of the week, the applied + :ivar time_in_week: If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - :type time_in_week: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeInWeek] - :param not_allowed_time: Time slots on which upgrade is not allowed. - :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeSpan] + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeSpan] """ _validation = { @@ -1305,6 +1724,13 @@ def __init__( not_allowed_time: Optional[List["TimeSpan"]] = None, **kwargs ): + """ + :keyword time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :paramtype time_in_week: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: list[~azure.mgmt.containerservice.v2021_10_01.models.TimeSpan] + """ super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time_in_week @@ -1316,8 +1742,8 @@ class MaintenanceConfigurationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of maintenance configurations. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration] + :ivar value: The list of maintenance configurations. + :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration] :ivar next_link: The URL to get the next set of maintenance configuration results. :vartype next_link: str """ @@ -1337,6 +1763,11 @@ def __init__( value: Optional[List["MaintenanceConfiguration"]] = None, **kwargs ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration] + """ super(MaintenanceConfigurationListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1355,10 +1786,10 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1383,6 +1814,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1404,32 +1841,32 @@ class ManagedCluster(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The managed cluster SKU. - :type sku: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKU - :param extended_location: The extended location of the Virtual Machine. - :type extended_location: ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocation - :param identity: The identity of the managed cluster, if configured. - :type identity: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterIdentity + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterIdentity :ivar provisioning_state: The current provisioning state. :vartype provisioning_state: str :ivar power_state: The Power State of the cluster. :vartype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState :ivar max_agent_pools: The max number of agent pools for the managed cluster. :vartype max_agent_pools: int - :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster `_ for more details. - :type kubernetes_version: str - :param dns_prefix: This cannot be updated once the Managed Cluster has been created. - :type dns_prefix: str - :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. - :type fqdn_subdomain: str + :vartype kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str :ivar fqdn: The FQDN of the master pool. :vartype fqdn: str :ivar private_fqdn: The FQDN of private cluster. @@ -1438,72 +1875,72 @@ class ManagedCluster(Resource): headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. :vartype azure_portal_fqdn: str - :param agent_pool_profiles: The agent pool properties. - :type agent_pool_profiles: + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAgentPoolProfile] - :param linux_profile: The profile for Linux VMs in the Managed Cluster. - :type linux_profile: + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceLinuxProfile - :param windows_profile: The profile for Windows VMs in the Managed Cluster. - :type windows_profile: + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterWindowsProfile - :param service_principal_profile: Information about a service principal identity for the - cluster to use for manipulating Azure APIs. - :type service_principal_profile: + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile - :param addon_profiles: The profile of managed cluster add-on. - :type addon_profiles: dict[str, + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAddonProfile] - :param pod_identity_profile: See `use AAD pod identity + :ivar pod_identity_profile: See `use AAD pod identity `_ for more details on AAD pod identity integration. - :type pod_identity_profile: + :vartype pod_identity_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProfile - :param node_resource_group: The name of the resource group containing agent pool nodes. - :type node_resource_group: str - :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :type enable_rbac: bool - :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. - :type enable_pod_security_policy: bool - :param network_profile: The network configuration profile. - :type network_profile: + :vartype enable_pod_security_policy: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceNetworkProfile - :param aad_profile: The Azure Active Directory configuration. - :type aad_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAADProfile - :param auto_upgrade_profile: The auto upgrade configuration. - :type auto_upgrade_profile: + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAutoUpgradeProfile - :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :type auto_scaler_profile: + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPropertiesAutoScalerProfile - :param api_server_access_profile: The access profile for managed cluster API server. - :type api_server_access_profile: + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAPIServerAccessProfile - :param disk_encryption_set_id: This is of the form: + :ivar disk_encryption_set_id: This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :type disk_encryption_set_id: str - :param identity_profile: Identities associated with the cluster. - :type identity_profile: dict[str, + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity] - :param private_link_resources: Private link resources associated with the cluster. - :type private_link_resources: + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] - :param disable_local_accounts: If set to true, getting static credentials will be disabled for + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see `disable local accounts `_. - :type disable_local_accounts: bool - :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. - :type http_proxy_config: + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterHTTPProxyConfig - :param security_profile: Security profile for the managed cluster. - :type security_profile: + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSecurityProfile - :param public_network_access: Allow or deny public network access for AKS. Possible values + :ivar public_network_access: Allow or deny public network access for AKS. Possible values include: "Enabled", "Disabled". - :type public_network_access: str or + :vartype public_network_access: str or ~azure.mgmt.containerservice.v2021_10_01.models.PublicNetworkAccess """ @@ -1595,6 +2032,97 @@ def __init__( public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: ~azure.mgmt.containerservice.v2021_10_01.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSecurityProfile + :keyword public_network_access: Allow or deny public network access for AKS. Possible values + include: "Enabled", "Disabled". + :paramtype public_network_access: str or + ~azure.mgmt.containerservice.v2021_10_01.models.PublicNetworkAccess + """ super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.extended_location = extended_location @@ -1634,22 +2162,22 @@ def __init__( class ManagedClusterAADProfile(msrest.serialization.Model): """For more details see `managed AAD on AKS `_. - :param managed: Whether to enable managed AAD. - :type managed: bool - :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :type enable_azure_rbac: bool - :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of the cluster. - :type admin_group_object_i_ds: list[str] - :param client_app_id: The client AAD application ID. - :type client_app_id: str - :param server_app_id: The server AAD application ID. - :type server_app_id: str - :param server_app_secret: The server AAD application secret. - :type server_app_secret: str - :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - :type tenant_id: str + :vartype tenant_id: str """ _attribute_map = { @@ -1674,6 +2202,24 @@ def __init__( tenant_id: Optional[str] = None, **kwargs ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed self.enable_azure_rbac = enable_azure_rbac @@ -1697,12 +2243,12 @@ class ManagedClusterAccessProfile(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param kube_config: Base64-encoded Kubernetes configuration file. - :type kube_config: bytearray + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray """ _validation = { @@ -1729,6 +2275,14 @@ def __init__( kube_config: Optional[bytearray] = None, **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config @@ -1740,10 +2294,10 @@ class ManagedClusterAddonProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param enabled: Required. Whether the add-on is enabled or not. - :type enabled: bool - :param config: Key-value pairs for configuring an add-on. - :type config: dict[str, str] + :ivar enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] :ivar identity: Information of user assigned identity used by this add-on. :vartype identity: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAddonProfileIdentity @@ -1767,6 +2321,12 @@ def __init__( config: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config @@ -1776,12 +2336,12 @@ def __init__( class UserAssignedIdentity(msrest.serialization.Model): """Details about a user assigned identity. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1798,6 +2358,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1807,12 +2375,12 @@ def __init__( class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): """Information of user assigned identity used by this add-on. - :param resource_id: The resource ID of the user assigned identity. - :type resource_id: str - :param client_id: The client ID of the user assigned identity. - :type client_id: str - :param object_id: The object ID of the user assigned identity. - :type object_id: str + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str """ _attribute_map = { @@ -1829,6 +2397,14 @@ def __init__( object_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) @@ -1837,140 +2413,142 @@ class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :vartype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData """ _validation = { @@ -2063,6 +2641,142 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + """ super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -2112,142 +2826,144 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): All required parameters must be populated in order to send to Azure. - :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - :type count: int - :param vm_size: VM size availability varies by region. If a node contains insufficient compute + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - :type vm_size: str - :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every - machine in the master/agent pool. If you specify 0, it will apply the default osDisk size - according to the vmSize specified. - :type os_disk_size_gb: int - :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see `Ephemeral OS `_. Possible values include: "Managed", "Ephemeral". - :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType - :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + :vartype os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". - :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType - :param workload_runtime: Determines the type of workload a node can run. Possible values + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values include: "OCIContainer", "WasmWasi". - :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime - :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type vnet_subnet_id: str - :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - :type pod_subnet_id: str - :param max_pods: The maximum number of pods that can run on a node. - :type max_pods: int - :param os_type: The operating system type. The default is Linux. Possible values include: + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. Possible values include: "Ubuntu", "CBLMariner". - :type os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU - :param max_count: The maximum number of nodes for auto-scaling. - :type max_count: int - :param min_count: The minimum number of nodes for auto-scaling. - :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler. - :type enable_auto_scaling: bool - :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: "Delete", "Deallocate". - :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode - :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + :vartype scale_down_mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", "AvailabilitySet". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType - :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + :vartype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", "User". - :type mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode - :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + :vartype mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see `upgrading a node pool `_. - :type orchestrator_version: str + :vartype orchestrator_version: str :ivar node_image_version: The version of node image. :vartype node_image_version: str - :param upgrade_settings: Settings for upgrading the agentpool. - :type upgrade_settings: + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings :ivar provisioning_state: The current deployment or provisioning state. :vartype provisioning_state: str - :param power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - :type power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState - :param availability_zones: The list of Availability zones to use for nodes. This can only be + :vartype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - :type availability_zones: list[str] - :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see `assigning a public IP per node `_. The default is false. - :type enable_node_public_ip: bool - :param node_public_ip_prefix_id: This is of the form: + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :type node_public_ip_prefix_id: str - :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the - default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". - :type scale_set_priority: str or + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority - :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", "Deallocate". Default value: "Delete". - :type scale_set_eviction_policy: str or + :vartype scale_set_eviction_policy: str or ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy - :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see `spot VMs pricing `_. - :type spot_max_price: float - :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale set. - :type tags: dict[str, str] - :param node_labels: The node labels to be persisted across all nodes in agent pool. - :type node_labels: dict[str, str] - :param node_taints: The taints added to new nodes during node pool create and scale. For + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - :type node_taints: list[str] - :param proximity_placement_group_id: The ID for Proximity Placement Group. - :type proximity_placement_group_id: str - :param kubelet_config: The Kubelet configuration on the agent pool nodes. - :type kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig - :param linux_os_config: The OS configuration of Linux agent nodes. - :type linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig - :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - :type enable_encryption_at_host: bool - :param enable_ultra_ssd: Whether to enable UltraSSD. - :type enable_ultra_ssd: bool - :param enable_fips: See `Add a FIPS-enabled node pool + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool `_ for more details. - :type enable_fips: bool - :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". - :type gpu_instance_profile: str or + :vartype gpu_instance_profile: str or ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile - :param creation_data: CreationData to be used to specify the source Snapshot ID if the node - pool will be created/upgraded using a snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData - :param name: Required. Windows agent pool names must be 6 characters or less. - :type name: str + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + :ivar name: Required. Windows agent pool names must be 6 characters or less. + :vartype name: str """ _validation = { @@ -2343,6 +3059,144 @@ def __init__( creation_data: Optional["CreationData"] = None, **kwargs ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_10_01.models.WorkloadRuntime + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_10_01.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_10_01.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: ~azure.mgmt.containerservice.v2021_10_01.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: ~azure.mgmt.containerservice.v2021_10_01.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_10_01.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + :keyword name: Required. Windows agent pool names must be 6 characters or less. + :paramtype name: str + """ super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, workload_runtime=workload_runtime, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, power_state=power_state, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, creation_data=creation_data, **kwargs) self.name = name @@ -2350,23 +3204,23 @@ def __init__( class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see `API server authorized IP ranges `_. - :type authorized_ip_ranges: list[str] - :param enable_private_cluster: For more details, see `Creating a private AKS cluster + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster `_. - :type enable_private_cluster: bool - :param private_dns_zone: The default is System. For more details see `configure private DNS - zone `_. - Allowed values are 'system' and 'none'. - :type private_dns_zone: str - :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private cluster or not. - :type enable_private_cluster_public_fqdn: bool - :param disable_run_command: Whether to disable run command for the cluster or not. - :type disable_run_command: bool + :vartype enable_private_cluster_public_fqdn: bool + :ivar disable_run_command: Whether to disable run command for the cluster or not. + :vartype disable_run_command: bool """ _attribute_map = { @@ -2387,6 +3241,25 @@ def __init__( disable_run_command: Optional[bool] = None, **kwargs ): + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :paramtype enable_private_cluster_public_fqdn: bool + :keyword disable_run_command: Whether to disable run command for the cluster or not. + :paramtype disable_run_command: bool + """ super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster @@ -2398,10 +3271,10 @@ def __init__( class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): """Auto upgrade profile for a managed cluster. - :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. Possible values include: "rapid", "stable", "patch", "node-image", "none". - :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_10_01.models.UpgradeChannel + :vartype upgrade_channel: str or ~azure.mgmt.containerservice.v2021_10_01.models.UpgradeChannel """ _attribute_map = { @@ -2414,6 +3287,13 @@ def __init__( upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, **kwargs ): + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Possible values include: "rapid", "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_10_01.models.UpgradeChannel + """ super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) self.upgrade_channel = upgrade_channel @@ -2421,14 +3301,14 @@ def __init__( class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): """Cluster HTTP proxy configuration. - :param http_proxy: The HTTP proxy server endpoint to use. - :type http_proxy: str - :param https_proxy: The HTTPS proxy server endpoint to use. - :type https_proxy: str - :param no_proxy: The endpoints that should not go through proxy. - :type no_proxy: list[str] - :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :type trusted_ca: str + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str """ _attribute_map = { @@ -2447,6 +3327,16 @@ def __init__( trusted_ca: Optional[str] = None, **kwargs ): + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) self.http_proxy = http_proxy self.https_proxy = https_proxy @@ -2465,13 +3355,13 @@ class ManagedClusterIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by master components. :vartype tenant_id: str - :param type: For more information see `use managed identities in AKS + :ivar type: For more information see `use managed identities in AKS `_. Possible values include: "SystemAssigned", "UserAssigned", "None". - :type type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ResourceIdentityType - :param user_assigned_identities: The keys must be ARM resource IDs in the form: + :vartype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, + :vartype user_assigned_identities: dict[str, ~azure.mgmt.containerservice.v2021_10_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ @@ -2494,6 +3384,16 @@ def __init__( user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): + """ + :keyword type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_10_01.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2506,8 +3406,8 @@ class ManagedClusterListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of managed clusters. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] :ivar next_link: The URL to get the next set of managed cluster results. :vartype next_link: str """ @@ -2527,6 +3427,10 @@ def __init__( value: Optional[List["ManagedCluster"]] = None, **kwargs ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] + """ super(ManagedClusterListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2535,30 +3439,29 @@ def __init__( class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :type managed_outbound_i_ps: + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :type outbound_ip_prefixes: + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :type outbound_i_ps: + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPs - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load balancer. - :type effective_outbound_i_ps: + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] - :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - :type allocated_outbound_ports: int - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - :type idle_timeout_in_minutes: int - :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS cluster or not. - :type enable_multiple_standard_load_balancers: bool + :vartype enable_multiple_standard_load_balancers: bool """ _validation = { @@ -2588,6 +3491,32 @@ def __init__( enable_multiple_standard_load_balancers: Optional[bool] = None, **kwargs ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] + :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + """ super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes @@ -2601,14 +3530,14 @@ def __init__( class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): """Desired managed outbound IPs for the cluster load balancer. - :param count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster + :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - :type count: int - :param count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + :vartype count: int + :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. - :type count_ipv6: int + :vartype count_ipv6: int """ _validation = { @@ -2628,6 +3557,16 @@ def __init__( count_ipv6: Optional[int] = 0, **kwargs ): + """ + :keyword count: The desired number of IPv4 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. + :paramtype count: int + :keyword count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :paramtype count_ipv6: int + """ super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count self.count_ipv6 = count_ipv6 @@ -2636,8 +3575,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): """Desired outbound IP Prefix resources for the cluster load balancer. - :param public_ip_prefixes: A list of public IP prefix resources. - :type public_ip_prefixes: + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] """ @@ -2651,6 +3590,11 @@ def __init__( public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes @@ -2658,8 +3602,8 @@ def __init__( class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_i_ps: A list of public IP resources. - :type public_i_ps: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] """ _attribute_map = { @@ -2672,6 +3616,10 @@ def __init__( public_i_ps: Optional[List["ResourceReference"]] = None, **kwargs ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] + """ super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) self.public_i_ps = public_i_ps @@ -2679,9 +3627,9 @@ def __init__( class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): """Profile of the managed outbound IP resources of the managed cluster. - :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - :type count: int + :vartype count: int """ _validation = { @@ -2698,6 +3646,11 @@ def __init__( count: Optional[int] = 1, **kwargs ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) self.count = count @@ -2705,16 +3658,16 @@ def __init__( class ManagedClusterNATGatewayProfile(msrest.serialization.Model): """Profile of the managed cluster NAT gateway. - :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster NAT gateway. - :type managed_outbound_ip_profile: + :vartype managed_outbound_ip_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterManagedOutboundIPProfile - :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. - :type effective_outbound_i_ps: + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :vartype effective_outbound_i_ps: list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] - :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :type idle_timeout_in_minutes: int + :vartype idle_timeout_in_minutes: int """ _validation = { @@ -2735,6 +3688,19 @@ def __init__( idle_timeout_in_minutes: Optional[int] = 4, **kwargs ): + """ + :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the + cluster NAT gateway. + :paramtype managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_10_01.models.ResourceReference] + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :paramtype idle_timeout_in_minutes: int + """ super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) self.managed_outbound_ip_profile = managed_outbound_ip_profile self.effective_outbound_i_ps = effective_outbound_i_ps @@ -2748,14 +3714,14 @@ class ManagedClusterPodIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity. - :type name: str - :param namespace: Required. The namespace of the pod identity. - :type namespace: str - :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :type binding_selector: str - :param identity: Required. The user assigned identity details. - :type identity: ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity + :ivar name: Required. The name of the pod identity. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. The user assigned identity details. + :vartype identity: ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Possible values include: "Assigned", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or @@ -2791,6 +3757,16 @@ def __init__( binding_selector: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The name of the pod identity. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. The user assigned identity details. + :paramtype identity: ~azure.mgmt.containerservice.v2021_10_01.models.UserAssignedIdentity + """ super(ManagedClusterPodIdentity, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2805,12 +3781,12 @@ class ManagedClusterPodIdentityException(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the pod identity exception. - :type name: str - :param namespace: Required. The namespace of the pod identity exception. - :type namespace: str - :param pod_labels: Required. The pod labels to match. - :type pod_labels: dict[str, str] + :ivar name: Required. The name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. The pod labels to match. + :vartype pod_labels: dict[str, str] """ _validation = { @@ -2833,6 +3809,14 @@ def __init__( pod_labels: Dict[str, str], **kwargs ): + """ + :keyword name: Required. The name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. The pod labels to match. + :paramtype pod_labels: dict[str, str] + """ super(ManagedClusterPodIdentityException, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -2842,19 +3826,19 @@ def __init__( class ManagedClusterPodIdentityProfile(msrest.serialization.Model): """See `use AAD pod identity `_ for more details on pod identity integration. - :param enabled: Whether the pod identity addon is enabled. - :type enabled: bool - :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet network plugin with AAD Pod Identity `_ for more information. - :type allow_network_plugin_kubenet: bool - :param user_assigned_identities: The pod identities to use in the cluster. - :type user_assigned_identities: + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: The pod identities to use in the cluster. + :vartype user_assigned_identities: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentity] - :param user_assigned_identity_exceptions: The pod identity exceptions to allow. - :type user_assigned_identity_exceptions: + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityException] """ @@ -2874,6 +3858,22 @@ def __init__( user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, **kwargs ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: The pod identities to use in the cluster. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityException] + """ super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) self.enabled = enabled self.allow_network_plugin_kubenet = allow_network_plugin_kubenet @@ -2884,8 +3884,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param error: Details about the error. - :type error: + :ivar error: Details about the error. + :vartype error: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningErrorBody """ @@ -2899,6 +3899,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs ): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) self.error = error @@ -2906,17 +3911,17 @@ def __init__( class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): """An error response from the pod identity provisioning. - :param code: An identifier for the error. Codes are invariant and are intended to be consumed + :ivar 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 + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in error. - :type target: str - :param details: A list of additional details about the error. - :type details: + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningErrorBody] """ @@ -2936,6 +3941,20 @@ def __init__( details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, **kwargs ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -2946,8 +3965,8 @@ def __init__( class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): """ManagedClusterPodIdentityProvisioningInfo. - :param error: Pod identity assignment error (if any). - :type error: + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningError """ @@ -2961,6 +3980,11 @@ def __init__( error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, **kwargs ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPodIdentityProvisioningError + """ super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) self.error = error @@ -2970,15 +3994,15 @@ class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param name: The Agent Pool name. - :type name: str - :param os_type: Required. The operating system type. The default is Linux. Possible values + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :vartype name: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values include: "Linux", "Windows". Default value: "Linux". - :type os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType - :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ @@ -3003,6 +4027,18 @@ def __init__( upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, **kwargs ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :paramtype name: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -3013,10 +4049,10 @@ def __init__( class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. - :param kubernetes_version: The Kubernetes version (major.minor.patch). - :type kubernetes_version: str - :param is_preview: Whether the Kubernetes version is currently in preview. - :type is_preview: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool """ _attribute_map = { @@ -3031,6 +4067,12 @@ def __init__( is_preview: Optional[bool] = None, **kwargs ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -3039,53 +4081,52 @@ def __init__( class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. - :param balance_similar_node_groups: Valid values are 'true' and 'false'. - :type balance_similar_node_groups: str - :param expander: If not specified, the default is 'random'. See `expanders + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar expander: If not specified, the default is 'random'. See `expanders `_ for more information. Possible values include: "least-waste", "most-pods", "priority", "random". - :type expander: str or ~azure.mgmt.containerservice.v2021_10_01.models.Expander - :param max_empty_bulk_delete: The default is 10. - :type max_empty_bulk_delete: str - :param max_graceful_termination_sec: The default is 600. - :type max_graceful_termination_sec: str - :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + :vartype expander: str or ~azure.mgmt.containerservice.v2021_10_01.models.Expander + :ivar max_empty_bulk_delete: The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type max_node_provision_time: str - :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is - 0. - :type max_total_unready_percentage: str - :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - :type new_pod_scale_up_delay: str - :param ok_total_unready_count: This must be an integer. The default is 3. - :type ok_total_unready_count: str - :param scan_interval: The default is '10'. Values must be an integer number of seconds. - :type scan_interval: str - :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_add: str - :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_delete: str - :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_delay_after_failure: str - :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unneeded_time: str - :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - :type scale_down_unready_time: str - :param scale_down_utilization_threshold: The default is '0.5'. - :type scale_down_utilization_threshold: str - :param skip_nodes_with_local_storage: The default is true. - :type skip_nodes_with_local_storage: str - :param skip_nodes_with_system_pods: The default is true. - :type skip_nodes_with_system_pods: str + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str """ _attribute_map = { @@ -3130,6 +4171,55 @@ def __init__( skip_nodes_with_system_pods: Optional[str] = None, **kwargs ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_10_01.models.Expander + :keyword max_empty_bulk_delete: The default is 10. + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: The default is 600. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.expander = expander @@ -3153,8 +4243,8 @@ def __init__( class ManagedClusterSecurityProfile(msrest.serialization.Model): """Security profile for the container service cluster. - :param azure_defender: Azure Defender settings for the security profile. - :type azure_defender: + :ivar azure_defender: Azure Defender settings for the security profile. + :vartype azure_defender: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSecurityProfileAzureDefender """ @@ -3168,6 +4258,11 @@ def __init__( azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, **kwargs ): + """ + :keyword azure_defender: Azure Defender settings for the security profile. + :paramtype azure_defender: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSecurityProfileAzureDefender + """ super(ManagedClusterSecurityProfile, self).__init__(**kwargs) self.azure_defender = azure_defender @@ -3175,12 +4270,13 @@ def __init__( class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): """Azure Defender settings for the security profile. - :param enabled: Whether to enable Azure Defender. - :type enabled: bool - :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + :ivar enabled: Whether to enable Azure Defender. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field is required and - must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. - :type log_analytics_workspace_resource_id: str + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :vartype log_analytics_workspace_resource_id: str """ _attribute_map = { @@ -3195,6 +4291,15 @@ def __init__( log_analytics_workspace_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword enabled: Whether to enable Azure Defender. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, this field should not + be exists. + :paramtype log_analytics_workspace_resource_id: str + """ super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) self.enabled = enabled self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id @@ -3205,10 +4310,10 @@ class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The ID for the service principal. - :type client_id: str - :param secret: The secret password associated with the service principal in plain text. - :type secret: str + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str """ _validation = { @@ -3227,6 +4332,12 @@ def __init__( secret: Optional[str] = None, **kwargs ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret @@ -3235,12 +4346,12 @@ def __init__( class ManagedClusterSKU(msrest.serialization.Model): """The SKU of a Managed Cluster. - :param name: The name of a managed cluster SKU. Possible values include: "Basic". - :type name: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUName - :param tier: If not specified, the default is 'Free'. See `uptime SLA + :ivar name: The name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA `_ for more details. Possible values include: "Paid", "Free". - :type tier: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUTier + :vartype tier: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUTier """ _attribute_map = { @@ -3255,6 +4366,14 @@ def __init__( tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, **kwargs ): + """ + :keyword name: The name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :paramtype tier: str or ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterSKUTier + """ super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier @@ -3273,12 +4392,12 @@ class ManagedClusterUpgradeProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the upgrade profile. :vartype type: str - :param control_plane_profile: Required. The list of available upgrade versions for the control + :ivar control_plane_profile: Required. The list of available upgrade versions for the control plane. - :type control_plane_profile: + :vartype control_plane_profile: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfile - :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. - :type agent_pool_profiles: + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfile] """ @@ -3305,6 +4424,15 @@ def __init__( agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], **kwargs ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterPoolUpgradeProfile] + """ super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3318,31 +4446,31 @@ class ManagedClusterWindowsProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param admin_username: Required. Specifies the name of the administrator account. + :ivar admin_username: Required. Specifies the name of the administrator account. :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character :code:`
`:code:`
` **Max-length:** 20 characters. - :type admin_username: str - :param admin_password: Specifies the password of the administrator account. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :type admin_password: str - :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + :vartype admin_password: str + :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. Possible values include: "None", "Windows_Server". - :type license_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.LicenseType - :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + :vartype license_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.LicenseType + :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo `_. - :type enable_csi_proxy: bool - :param gmsa_profile: The Windows gMSA Profile in the Managed Cluster. - :type gmsa_profile: ~azure.mgmt.containerservice.v2021_10_01.models.WindowsGmsaProfile + :vartype enable_csi_proxy: bool + :ivar gmsa_profile: The Windows gMSA Profile in the Managed Cluster. + :vartype gmsa_profile: ~azure.mgmt.containerservice.v2021_10_01.models.WindowsGmsaProfile """ _validation = { @@ -3367,6 +4495,33 @@ def __init__( gmsa_profile: Optional["WindowsGmsaProfile"] = None, **kwargs ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :paramtype license_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.LicenseType + :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :paramtype enable_csi_proxy: bool + :keyword gmsa_profile: The Windows gMSA Profile in the Managed Cluster. + :paramtype gmsa_profile: ~azure.mgmt.containerservice.v2021_10_01.models.WindowsGmsaProfile + """ super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password @@ -3400,6 +4555,8 @@ def __init__( self, **kwargs ): + """ + """ super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -3426,6 +4583,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None @@ -3471,6 +4630,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -3493,8 +4654,8 @@ class OSOptionProfile(msrest.serialization.Model): :vartype name: str :ivar type: The type of the OS option resource. :vartype type: str - :param os_option_property_list: Required. The list of OS options. - :type os_option_property_list: + :ivar os_option_property_list: Required. The list of OS options. + :vartype os_option_property_list: list[~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProperty] """ @@ -3518,6 +4679,11 @@ def __init__( os_option_property_list: List["OSOptionProperty"], **kwargs ): + """ + :keyword os_option_property_list: Required. The list of OS options. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProperty] + """ super(OSOptionProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -3530,10 +4696,10 @@ class OSOptionProperty(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param os_type: Required. The OS type. - :type os_type: str - :param enable_fips_image: Required. Whether the image is FIPS-enabled. - :type enable_fips_image: bool + :ivar os_type: Required. The OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether the image is FIPS-enabled. + :vartype enable_fips_image: bool """ _validation = { @@ -3553,6 +4719,12 @@ def __init__( enable_fips_image: bool, **kwargs ): + """ + :keyword os_type: Required. The OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether the image is FIPS-enabled. + :paramtype enable_fips_image: bool + """ super(OSOptionProperty, self).__init__(**kwargs) self.os_type = os_type self.enable_fips_image = enable_fips_image @@ -3561,11 +4733,11 @@ def __init__( class OutboundEnvironmentEndpoint(msrest.serialization.Model): """Egress endpoints which AKS agent nodes connect to for common purpose. - :param category: The category of endpoints accessed by the AKS agent node, e.g. + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - :type category: str - :param endpoints: The endpoints that AKS agent nodes connect to. - :type endpoints: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDependency] + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDependency] """ _attribute_map = { @@ -3580,6 +4752,13 @@ def __init__( endpoints: Optional[List["EndpointDependency"]] = None, **kwargs ): + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: list[~azure.mgmt.containerservice.v2021_10_01.models.EndpointDependency] + """ super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) self.category = category self.endpoints = endpoints @@ -3592,8 +4771,9 @@ class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param value: Required. Collection of resources. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpoint] + :ivar value: Required. Collection of resources. + :vartype value: + list[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3614,6 +4794,11 @@ def __init__( value: List["OutboundEnvironmentEndpoint"], **kwargs ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpoint] + """ super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) self.value = value self.next_link = None @@ -3622,9 +4807,9 @@ def __init__( class PowerState(msrest.serialization.Model): """Describes the Power State of the cluster. - :param code: Tells whether the cluster is Running or Stopped. Possible values include: + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: "Running", "Stopped". - :type code: str or ~azure.mgmt.containerservice.v2021_10_01.models.Code + :vartype code: str or ~azure.mgmt.containerservice.v2021_10_01.models.Code """ _attribute_map = { @@ -3637,6 +4822,11 @@ def __init__( code: Optional[Union[str, "Code"]] = None, **kwargs ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_10_01.models.Code + """ super(PowerState, self).__init__(**kwargs) self.code = code @@ -3644,8 +4834,8 @@ def __init__( class PrivateEndpoint(msrest.serialization.Model): """Private endpoint which a connection belongs to. - :param id: The resource ID of the private endpoint. - :type id: str + :ivar id: The resource ID of the private endpoint. + :vartype id: str """ _attribute_map = { @@ -3658,6 +4848,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = id @@ -3677,11 +4871,11 @@ class PrivateEndpointConnection(msrest.serialization.Model): "Creating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnectionProvisioningState - :param private_endpoint: The resource of private endpoint. - :type private_endpoint: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpoint - :param private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :type private_link_service_connection_state: + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkServiceConnectionState """ @@ -3708,6 +4902,14 @@ def __init__( private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkServiceConnectionState + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None self.name = None @@ -3720,8 +4922,8 @@ def __init__( class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3734,6 +4936,11 @@ def __init__( value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection] + """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3743,16 +4950,16 @@ class PrivateLinkResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the private link resource. - :type id: str - :param name: The name of the private link resource. - :type name: str - :param type: The resource type. - :type type: str - :param group_id: The group ID of the resource. - :type group_id: str - :param required_members: The RequiredMembers of the resource. - :type required_members: list[str] + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] :ivar private_link_service_id: The private link service ID of the resource, this field is exposed only to NRP internally. :vartype private_link_service_id: str @@ -3781,6 +4988,18 @@ def __init__( required_members: Optional[List[str]] = None, **kwargs ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = id self.name = name @@ -3793,8 +5012,8 @@ def __init__( class PrivateLinkResourcesListResult(msrest.serialization.Model): """A list of private link resources. - :param value: The collection value. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] """ _attribute_map = { @@ -3807,6 +5026,10 @@ def __init__( value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): + """ + :keyword value: The collection value. + :paramtype value: list[~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource] + """ super(PrivateLinkResourcesListResult, self).__init__(**kwargs) self.value = value @@ -3814,11 +5037,11 @@ def __init__( class PrivateLinkServiceConnectionState(msrest.serialization.Model): """The state of a private link service connection. - :param status: The private link service connection status. Possible values include: "Pending", + :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :type status: str or ~azure.mgmt.containerservice.v2021_10_01.models.ConnectionStatus - :param description: The private link service connection description. - :type description: str + :vartype status: str or ~azure.mgmt.containerservice.v2021_10_01.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str """ _attribute_map = { @@ -3833,6 +5056,13 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or ~azure.mgmt.containerservice.v2021_10_01.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description @@ -3841,8 +5071,8 @@ def __init__( class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. - :param id: The fully qualified Azure resource id. - :type id: str + :ivar id: The fully qualified Azure resource id. + :vartype id: str """ _attribute_map = { @@ -3855,6 +5085,10 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ super(ResourceReference, self).__init__(**kwargs) self.id = id @@ -3864,12 +5098,12 @@ class RunCommandRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param command: Required. The command to run. - :type command: str - :param context: A base64 encoded zip file containing the files required by the command. - :type context: str - :param cluster_token: AuthToken issued for AKS AAD Server App. - :type cluster_token: str + :ivar command: Required. The command to run. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str """ _validation = { @@ -3890,6 +5124,14 @@ def __init__( cluster_token: Optional[str] = None, **kwargs ): + """ + :keyword command: Required. The command to run. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ super(RunCommandRequest, self).__init__(**kwargs) self.command = command self.context = context @@ -3941,6 +5183,8 @@ def __init__( self, **kwargs ): + """ + """ super(RunCommandResult, self).__init__(**kwargs) self.id = None self.provisioning_state = None @@ -3964,18 +5208,18 @@ class Snapshot(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar system_data: The system metadata relating to this snapshot. :vartype system_data: ~azure.mgmt.containerservice.v2021_10_01.models.SystemData - :param creation_data: CreationData to be used to specify the source agent pool resource ID to + :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to create this snapshot. - :type creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData - :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + :vartype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + :ivar snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: "NodePool". Default value: "NodePool". - :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.SnapshotType + :vartype snapshot_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.SnapshotType :ivar kubernetes_version: The version of Kubernetes. :vartype kubernetes_version: str :ivar node_image_version: The version of node image. @@ -4032,6 +5276,18 @@ def __init__( snapshot_type: Optional[Union[str, "SnapshotType"]] = "NodePool", **kwargs ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_10_01.models.CreationData + :keyword snapshot_type: The type of a snapshot. The default is NodePool. Possible values + include: "NodePool". Default value: "NodePool". + :paramtype snapshot_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.SnapshotType + """ super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) self.system_data = None self.creation_data = creation_data @@ -4049,8 +5305,8 @@ class SnapshotListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: The list of snapshots. - :type value: list[~azure.mgmt.containerservice.v2021_10_01.models.Snapshot] + :ivar value: The list of snapshots. + :vartype value: list[~azure.mgmt.containerservice.v2021_10_01.models.Snapshot] :ivar next_link: The URL to get the next set of snapshot results. :vartype next_link: str """ @@ -4070,6 +5326,10 @@ def __init__( value: Optional[List["Snapshot"]] = None, **kwargs ): + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2021_10_01.models.Snapshot] + """ super(SnapshotListResult, self).__init__(**kwargs) self.value = value self.next_link = None @@ -4078,62 +5338,62 @@ def __init__( class SysctlConfig(msrest.serialization.Model): """Sysctl settings for Linux agent nodes. - :param net_core_somaxconn: Sysctl setting net.core.somaxconn. - :type net_core_somaxconn: int - :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :type net_core_netdev_max_backlog: int - :param net_core_rmem_default: Sysctl setting net.core.rmem_default. - :type net_core_rmem_default: int - :param net_core_rmem_max: Sysctl setting net.core.rmem_max. - :type net_core_rmem_max: int - :param net_core_wmem_default: Sysctl setting net.core.wmem_default. - :type net_core_wmem_default: int - :param net_core_wmem_max: Sysctl setting net.core.wmem_max. - :type net_core_wmem_max: int - :param net_core_optmem_max: Sysctl setting net.core.optmem_max. - :type net_core_optmem_max: int - :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :type net_ipv4_tcp_max_syn_backlog: int - :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :type net_ipv4_tcp_max_tw_buckets: int - :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :type net_ipv4_tcp_fin_timeout: int - :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :type net_ipv4_tcp_keepalive_time: int - :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :type net_ipv4_tcp_keepalive_probes: int - :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :type net_ipv4_tcpkeepalive_intvl: int - :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :type net_ipv4_tcp_tw_reuse: bool - :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :type net_ipv4_ip_local_port_range: str - :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :type net_ipv4_neigh_default_gc_thresh1: int - :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :type net_ipv4_neigh_default_gc_thresh2: int - :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :type net_ipv4_neigh_default_gc_thresh3: int - :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :type net_netfilter_nf_conntrack_max: int - :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :type net_netfilter_nf_conntrack_buckets: int - :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :type fs_inotify_max_user_watches: int - :param fs_file_max: Sysctl setting fs.file-max. - :type fs_file_max: int - :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :type fs_aio_max_nr: int - :param fs_nr_open: Sysctl setting fs.nr_open. - :type fs_nr_open: int - :param kernel_threads_max: Sysctl setting kernel.threads-max. - :type kernel_threads_max: int - :param vm_max_map_count: Sysctl setting vm.max_map_count. - :type vm_max_map_count: int - :param vm_swappiness: Sysctl setting vm.swappiness. - :type vm_swappiness: int - :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :type vm_vfs_cache_pressure: int + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int """ _attribute_map = { @@ -4200,6 +5460,64 @@ def __init__( vm_vfs_cache_pressure: Optional[int] = None, **kwargs ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ super(SysctlConfig, self).__init__(**kwargs) self.net_core_somaxconn = net_core_somaxconn self.net_core_netdev_max_backlog = net_core_netdev_max_backlog @@ -4234,21 +5552,21 @@ def __init__( 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.containerservice.v2021_10_01.models.CreatedByType - :param created_at: The UTC timestamp of resource creation. - :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 + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.CreatedByType + :ivar created_at: The UTC timestamp of resource creation. + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar 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 + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.v2021_10_01.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -4271,6 +5589,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.CreatedByType + :keyword created_at: The UTC timestamp of resource creation. + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_10_01.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -4283,8 +5619,8 @@ def __init__( class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -4297,6 +5633,10 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TagsObject, self).__init__(**kwargs) self.tags = tags @@ -4304,13 +5644,13 @@ def __init__( class TimeInWeek(msrest.serialization.Model): """Time in a week. - :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". - :type day: str or ~azure.mgmt.containerservice.v2021_10_01.models.WeekDay - :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + :vartype day: str or ~azure.mgmt.containerservice.v2021_10_01.models.WeekDay + :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - :type hour_slots: list[int] + :vartype hour_slots: list[int] """ _attribute_map = { @@ -4325,6 +5665,15 @@ def __init__( hour_slots: Optional[List[int]] = None, **kwargs ): + """ + :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_10_01.models.WeekDay + :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :paramtype hour_slots: list[int] + """ super(TimeInWeek, self).__init__(**kwargs) self.day = day self.hour_slots = hour_slots @@ -4333,10 +5682,10 @@ def __init__( class TimeSpan(msrest.serialization.Model): """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - :param start: The start of a time span. - :type start: ~datetime.datetime - :param end: The end of a time span. - :type end: ~datetime.datetime + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime """ _attribute_map = { @@ -4351,6 +5700,12 @@ def __init__( end: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ super(TimeSpan, self).__init__(**kwargs) self.start = start self.end = end @@ -4359,16 +5714,16 @@ def __init__( class WindowsGmsaProfile(msrest.serialization.Model): """Windows gMSA Profile in the managed cluster. - :param enabled: Specifies whether to enable Windows gMSA in the managed cluster. - :type enabled: bool - :param dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it - to empty if you have configured the DNS server in the vnet which is used to create the managed + :ivar enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it to + empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - :type dns_server: str - :param root_domain_name: Specifies the root domain name for Windows gMSA. + :vartype dns_server: str + :ivar root_domain_name: Specifies the root domain name for Windows gMSA. :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - :type root_domain_name: str + :vartype root_domain_name: str """ _attribute_map = { @@ -4385,6 +5740,18 @@ def __init__( root_domain_name: Optional[str] = None, **kwargs ): + """ + :keyword enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :paramtype enabled: bool + :keyword dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it + to empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :paramtype dns_server: str + :keyword root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :paramtype root_domain_name: str + """ super(WindowsGmsaProfile, self).__init__(**kwargs) self.enabled = enabled self.dns_server = dns_server diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py index f5371a985890..d7f94ff9e70a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py @@ -5,25 +5,292 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class AgentPoolsOperations(object): """AgentPoolsOperations operations. @@ -47,13 +314,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AgentPoolListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: """Gets a list of agent pools in the specified managed cluster. Gets a list of agent pools in the specified managed cluster. @@ -64,7 +331,8 @@ def list( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] @@ -72,36 +340,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + deserialized = self._deserialize("AgentPoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,19 +384,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": """Gets the specified managed cluster agent pool. Gets the specified managed cluster agent pool. @@ -152,28 +418,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,49 +443,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPool" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'AgentPool') - 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 @@ -247,17 +494,19 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - parameters, # type: "_models.AgentPool" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Creates or updates an agent pool in the specified managed cluster. Creates or updates an agent pool in the specified managed cluster. @@ -272,15 +521,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -293,28 +546,21 @@ def begin_create_or_update( resource_name=resource_name, agent_pool_name=agent_pool_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -326,43 +572,33 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> 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-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -375,14 +611,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an agent pool in the specified managed cluster. Deletes an agent pool in the specified managed cluster. @@ -395,15 +632,17 @@ def begin_delete( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -418,22 +657,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -445,16 +676,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolUpgradeProfile" + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": """Gets the upgrade profile for an agent pool. Gets the upgrade profile for an agent pool. @@ -475,28 +707,18 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,15 +732,17 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_available_agent_pool_versions( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AgentPoolAvailableVersions" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": """Gets a list of supported Kubernetes versions for the specified agent pool. See `supported Kubernetes versions @@ -539,27 +763,17 @@ def get_available_agent_pool_versions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_available_agent_pool_versions.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,43 +787,34 @@ def get_available_agent_pool_versions( return cls(pipeline_response, deserialized, {}) return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + def _upgrade_node_image_version_initial( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -617,26 +822,29 @@ def _upgrade_node_image_version_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 202: response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('AgentPool', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + @distributed_trace def begin_upgrade_node_image_version( self, - resource_group_name, # type: str - resource_name, # type: str - agent_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AgentPool"] + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: """Upgrades the node image version of an agent pool to the latest. Upgrading the node image version of an agent pool applies the newest OS and runtime updates to @@ -651,15 +859,18 @@ def begin_upgrade_node_image_version( :type agent_pool_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] lro_delay = kwargs.pop( 'polling_interval', @@ -674,28 +885,20 @@ def begin_upgrade_node_image_version( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('AgentPool', pipeline_response) - if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -707,4 +910,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py index 9dee631e8b08..4d004d230d62 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py @@ -5,23 +5,181 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MaintenanceConfigurationsOperations(object): """MaintenanceConfigurationsOperations operations. @@ -45,13 +203,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_managed_cluster( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: """Gets a list of maintenance configurations in the specified managed cluster. Gets a list of maintenance configurations in the specified managed cluster. @@ -61,8 +219,10 @@ def list_by_managed_cluster( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfigurationListResult] + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] @@ -70,36 +230,33 @@ def list_by_managed_cluster( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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_managed_cluster.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,19 +274,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Gets the specified maintenance configuration of a managed cluster. Gets the specified maintenance configuration of a managed cluster. @@ -150,28 +308,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,17 +333,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - parameters, # type: "_models.MaintenanceConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.MaintenanceConfiguration" + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": """Creates or updates a maintenance configuration in the specified managed cluster. Creates or updates a maintenance configuration in the specified managed cluster. @@ -218,33 +368,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') - 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 @@ -258,16 +398,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - config_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: """Deletes a maintenance configuration. Deletes a maintenance configuration. @@ -288,28 +430,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'configName': self._serialize.url("config_name", config_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,3 +453,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py index d5128859a56a..ea00722f005e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py @@ -5,25 +5,785 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ManagedClustersOperations(object): """ManagedClustersOperations operations. @@ -47,13 +807,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_os_options( self, - location, # type: str - resource_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OSOptionProfile" + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": """Gets supported OS options in the specified subscription. Gets supported OS options in the specified subscription. @@ -72,28 +832,17 @@ def get_os_options( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_os_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if resource_type is not None: - query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -107,20 +856,24 @@ def get_os_options( return cls(pipeline_response, deserialized, {}) return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Gets a list of managed clusters in the specified subscription. Gets a list of managed clusters in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -128,34 +881,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -173,17 +921,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ManagedClusterListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: """Lists managed clusters in the specified subscription and resource group. Lists managed clusters in the specified subscription and resource group. @@ -191,8 +940,10 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :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 ManagedClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] @@ -200,35 +951,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -246,18 +993,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + @distributed_trace def get_upgrade_profile( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterUpgradeProfile" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": """Gets the upgrade profile of a managed cluster. Gets the upgrade profile of a managed cluster. @@ -276,27 +1024,17 @@ def get_upgrade_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_upgrade_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,16 +1048,18 @@ def get_upgrade_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + @distributed_trace def get_access_profile( self, - resource_group_name, # type: str - resource_name, # type: str - role_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedClusterAccessProfile" + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": """Gets an access profile of a managed cluster. **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials @@ -343,28 +1083,18 @@ def get_access_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_access_profile.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'roleName': self._serialize.url("role_name", role_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,16 +1108,18 @@ def get_access_profile( return cls(pipeline_response, deserialized, {}) return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + @distributed_trace def list_cluster_admin_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the admin credentials of a managed cluster. Lists the admin credentials of a managed cluster. @@ -408,29 +1140,18 @@ def list_cluster_admin_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -444,16 +1165,18 @@ def list_cluster_admin_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + @distributed_trace def list_cluster_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the user credentials of a managed cluster. Lists the user credentials of a managed cluster. @@ -474,29 +1197,18 @@ def list_cluster_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -510,16 +1222,18 @@ def list_cluster_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + @distributed_trace def list_cluster_monitoring_user_credentials( self, - resource_group_name, # type: str - resource_name, # type: str - server_fqdn=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.CredentialResults" + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": """Lists the cluster monitoring user credentials of a managed cluster. Lists the cluster monitoring user credentials of a managed cluster. @@ -540,29 +1254,18 @@ def list_cluster_monitoring_user_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 server_fqdn is not None: - query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -576,15 +1279,17 @@ def list_cluster_monitoring_user_credentials( return cls(pipeline_response, deserialized, {}) return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": """Gets a managed cluster. Gets a managed cluster. @@ -603,27 +1308,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -637,47 +1332,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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 = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') - # 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') + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedCluster') - 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 @@ -695,16 +1381,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedCluster" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Creates or updates a managed cluster. Creates or updates a managed cluster. @@ -717,15 +1405,20 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -737,27 +1430,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -769,47 +1456,37 @@ def get_long_running_output(pipeline_response): ) 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.ContainerService/managedClusters/{resourceName}'} # type: ignore def _update_tags_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ManagedCluster" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_tags_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -823,16 +1500,18 @@ def _update_tags_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedCluster"] + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: """Updates tags on a managed cluster. Updates tags on a managed cluster. @@ -845,15 +1524,20 @@ def begin_update_tags( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.TagsObject :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -865,27 +1549,21 @@ def begin_update_tags( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ManagedCluster', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -897,41 +1575,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -944,13 +1612,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a managed cluster. Deletes a managed cluster. @@ -961,15 +1630,17 @@ def begin_delete( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -983,21 +1654,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1009,47 +1673,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _reset_service_principal_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> 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-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') - 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 @@ -1062,14 +1716,15 @@ def _reset_service_principal_profile_initial( _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + @distributed_trace def begin_reset_service_principal_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterServicePrincipalProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the Service Principal Profile of a managed cluster. This action cannot be performed on a cluster that is not using a service principal. @@ -1079,18 +1734,22 @@ def begin_reset_service_principal_profile( :param resource_name: The name of the managed cluster resource. :type resource_name: str :param parameters: The service principal profile to set on the managed cluster. - :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile + :type parameters: + ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterServicePrincipalProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1102,24 +1761,18 @@ def begin_reset_service_principal_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1131,47 +1784,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore def _reset_aad_profile_initial( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> 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-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reset_aad_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') - # 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') + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') - 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 @@ -1184,14 +1827,15 @@ def _reset_aad_profile_initial( _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + @distributed_trace def begin_reset_aad_profile( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.ManagedClusterAADProfile" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. Reset the AAD Profile of a managed cluster. @@ -1204,15 +1848,18 @@ def begin_reset_aad_profile( :type parameters: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAADProfile :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1224,24 +1871,18 @@ def begin_reset_aad_profile( resource_group_name=resource_group_name, resource_name=resource_name, parameters=parameters, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1253,41 +1894,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore def _rotate_cluster_certificates_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-10-01" - accept = "application/json" - - # Construct URL - url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1300,13 +1931,14 @@ def _rotate_cluster_certificates_initial( _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + @distributed_trace def begin_rotate_cluster_certificates( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Rotates the certificates of a managed cluster. See `Certificate rotation `_ for @@ -1318,15 +1950,17 @@ def begin_rotate_cluster_certificates( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1340,21 +1974,14 @@ def begin_rotate_cluster_certificates( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,41 +1993,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore def _stop_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-10-01" - accept = "application/json" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1413,13 +2030,14 @@ def _stop_initial( _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + @distributed_trace def begin_stop( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Stops a Managed Cluster. This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a @@ -1434,15 +2052,17 @@ def begin_stop( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1456,21 +2076,14 @@ def begin_stop( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,41 +2095,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore def _start_initial( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> 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-10-01" - accept = "application/json" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1529,13 +2132,14 @@ def _start_initial( _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + @distributed_trace def begin_start( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Starts a previously stopped Managed Cluster. See `starting a cluster `_ for more @@ -1547,15 +2151,17 @@ def begin_start( :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1569,21 +2175,14 @@ def begin_start( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1595,47 +2194,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore def _run_command_initial( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._run_command_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') - # 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') + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request_payload, 'RunCommandRequest') - 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 @@ -1651,16 +2240,18 @@ def _run_command_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace def begin_run_command( self, - resource_group_name, # type: str - resource_name, # type: str - request_payload, # type: "_models.RunCommandRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: """Submits a command to run against the Managed Cluster. AKS will create a pod to run the command. This is primarily useful for private clusters. For @@ -1675,15 +2266,20 @@ def begin_run_command( :type request_payload: ~azure.mgmt.containerservice.v2021_10_01.models.RunCommandRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1695,27 +2291,21 @@ def begin_run_command( resource_group_name=resource_group_name, resource_name=resource_name, request_payload=request_payload, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RunCommandResult', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1727,16 +2317,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + @distributed_trace def get_command_result( self, - resource_group_name, # type: str - resource_name, # type: str - command_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RunCommandResult"] + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: """Gets the results of a command which has been run on the Managed Cluster. Gets the results of a command which has been run on the Managed Cluster. @@ -1757,28 +2348,18 @@ def get_command_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get_command_result.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'commandId': self._serialize.url("command_id", command_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1794,16 +2375,19 @@ def get_command_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + @distributed_trace def list_outbound_network_dependencies_endpoints( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. @@ -1813,8 +2397,10 @@ def list_outbound_network_dependencies_endpoints( :param resource_name: The name of the managed cluster resource. :type resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpointCollection] + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OutboundEnvironmentEndpointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] @@ -1822,36 +2408,33 @@ def list_outbound_network_dependencies_endpoints( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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_outbound_network_dependencies_endpoints.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1869,6 +2452,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py index bd021662ea57..4553c1abb224 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py @@ -5,23 +5,50 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,18 +72,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Gets a list of operations. Gets a list of operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OperationListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -64,30 +92,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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 = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - 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) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,6 +130,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py index f3c94368dcf9..52055a5b08e3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py @@ -5,24 +5,182 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -46,13 +204,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnectionListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": """Gets a list of private endpoint connections in the specified managed cluster. To learn more about private clusters, see: @@ -72,27 +230,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -106,16 +254,18 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection. To learn more about private clusters, see: @@ -137,28 +287,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -172,17 +312,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - parameters, # type: "_models.PrivateEndpointConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateEndpointConnection" + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": """Updates a private endpoint connection. Updates a private endpoint connection. @@ -205,33 +347,23 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - 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 @@ -245,43 +377,34 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> 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-10-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,14 +417,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - resource_name, # type: str - private_endpoint_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a private endpoint connection. Deletes a private endpoint connection. @@ -314,15 +438,17 @@ def begin_delete( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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. + :keyword int polling_interval: 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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -337,22 +463,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -364,4 +482,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py index 02db72636e54..f173eaf71f3d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py @@ -5,22 +5,59 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -44,13 +81,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResourcesListResult" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": """Gets a list of private link resources in the specified managed cluster. To learn more about private clusters, see: @@ -70,27 +107,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(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 = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # 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 @@ -104,4 +131,6 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py index 5ba0e0d37f0e..617d8011cd33 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py @@ -5,22 +5,69 @@ # 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 functools +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 HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ResolvePrivateLinkServiceIdOperations(object): """ResolvePrivateLinkServiceIdOperations operations. @@ -44,14 +91,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def post( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.PrivateLinkResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Gets the private link service ID for the specified managed cluster. Gets the private link service ID for the specified managed cluster. @@ -72,32 +119,22 @@ def post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.post.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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') + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PrivateLinkResource') - 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 @@ -111,4 +148,6 @@ def post( return cls(pipeline_response, deserialized, {}) return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py index eb3acfbedaa1..b1803e280a64 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py @@ -5,23 +5,248 @@ # 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer 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]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-10-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class SnapshotsOperations(object): """SnapshotsOperations operations. @@ -45,18 +270,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SnapshotListResult"] + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: """Gets a list of snapshots in the specified subscription. Gets a list of snapshots in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -64,34 +290,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,17 +330,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SnapshotListResult"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: """Lists snapshots in the specified subscription and resource group. Lists snapshots in the specified subscription and resource group. @@ -128,7 +350,8 @@ def list_by_resource_group( :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 SnapshotListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_10_01.models.SnapshotListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] @@ -136,35 +359,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-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', min_length=1), - } - url = self._client.format_url(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) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SnapshotListResult', pipeline_response) + deserialized = self._deserialize("SnapshotListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,18 +401,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": """Gets a snapshot. Gets a snapshot. @@ -212,27 +432,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -246,16 +456,18 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.Snapshot" - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": """Creates or updates a snapshot. Creates or updates a snapshot. @@ -276,32 +488,22 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') - # 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') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Snapshot') - 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 @@ -319,16 +521,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def update_tags( self, - resource_group_name, # type: str - resource_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.Snapshot" + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": """Updates tags on a snapshot. Updates tags on a snapshot. @@ -349,32 +553,22 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_tags.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') - # 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') + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TagsObject') - 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 @@ -388,15 +582,17 @@ def update_tags( return cls(pipeline_response, deserialized, {}) return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + @distributed_trace def delete( self, - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: """Deletes a snapshot. Deletes a snapshot. @@ -415,27 +611,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-10-01" - accept = "application/json" - - # Construct URL - url = self.delete.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', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -447,3 +633,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py new file mode 100644 index 000000000000..53c675bd95e2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py new file mode 100644 index 000000000000..a2197ce987c2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. + + 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: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-11-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.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 = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_container_service_client.py new file mode 100644 index 000000000000..4858728ba71c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_container_service_client.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class ContainerServiceClient: + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2021_11_01_preview.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_11_01_preview.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_11_01_preview.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_11_01_preview.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_11_01_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_11_01_preview.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_11_01_preview.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2021_11_01_preview.operations.SnapshotsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ContainerServiceClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_metadata.json new file mode 100644 index 000000000000..5e9fcc11ddee --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_metadata.json @@ -0,0 +1,109 @@ +{ + "chosen_version": "2021-11-01-preview", + "total_api_version_list": ["2021-11-01-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": 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\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "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": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "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": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "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=\"https://management.azure.com\", # type: 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: str = \"https://management.azure.com\",", + "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_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "snapshots": "SnapshotsOperations" + } +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/__init__.py new file mode 100644 index 000000000000..53c675bd95e2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..1b3505565c47 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_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, AsyncARMChallengeAuthenticationPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. + + 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: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-11-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.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 = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_container_service_client.py new file mode 100644 index 000000000000..7d02e1512dab --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_container_service_client.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import ContainerServiceClientConfiguration +from .operations import AgentPoolsOperations, MaintenanceConfigurationsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class ContainerServiceClient: + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2021_11_01_preview.aio.operations.SnapshotsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations(self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ContainerServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..5e1e5e72fa59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'MaintenanceConfigurationsOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', + 'SnapshotsOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..71955135464b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py @@ -0,0 +1,650 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_available_agent_pool_versions_request, build_get_request, build_get_upgrade_profile_request, build_list_request, build_upgrade_node_image_version_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AgentPoolsOperations: + """AgentPoolsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AgentPoolListResult"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> AsyncLROPoller["_models.AgentPool"]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.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( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('AgentPool', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace_async + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('AgentPoolUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + + @distributed_trace_async + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolAvailableVersions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('AgentPoolAvailableVersions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + + + async def _upgrade_node_image_version_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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 + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + + @distributed_trace_async + async def begin_upgrade_node_image_version( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.AgentPool"]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + deserialized = self._deserialize('AgentPool', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..812998aeebb7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,300 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_managed_cluster_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MaintenanceConfigurationsOperations: + """MaintenanceConfigurationsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list_by_managed_cluster( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.MaintenanceConfigurationListResult"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :param parameters: The maintenance configuration to create or update. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..686ffc0c1dbb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1702 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_access_profile_request, build_get_command_result_request, build_get_os_options_request, build_get_request, build_get_upgrade_profile_request, build_list_by_resource_group_request, build_list_cluster_admin_credentials_request, build_list_cluster_monitoring_user_credentials_request, build_list_cluster_user_credentials_request, build_list_outbound_network_dependencies_endpoints_request, build_list_request, build_reset_aad_profile_request_initial, build_reset_service_principal_profile_request_initial, build_rotate_cluster_certificates_request_initial, build_run_command_request_initial, build_start_request_initial, build_stop_request_initial, build_update_tags_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ManagedClustersOperations: + """ManagedClustersOperations 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.containerservice.v2021_11_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 + + @distributed_trace_async + async def get_os_options( + self, + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OSOptionProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('OSOptionProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterListResult"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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.ContainerService/managedClusters'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterListResult"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :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 ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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.ContainerService/managedClusters'} # type: ignore + + @distributed_trace_async + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedClusterUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + + @distributed_trace_async + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": + """Gets an access profile of a managed cluster. + + **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. + :type role_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAccessProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterAccessProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedClusterAccessProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + + @distributed_trace_async + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + + @distributed_trace_async + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the user credentials of a managed cluster. + + Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + + @distributed_trace_async + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": + """Gets a managed cluster. + + Gets a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> AsyncLROPoller["_models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The managed cluster to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.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( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> AsyncLROPoller["_models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _reset_service_principal_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + + @distributed_trace_async + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterServicePrincipalProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.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._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + async def _reset_aad_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + + @distributed_trace_async + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD Profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAADProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.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._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + async def _rotate_cluster_certificates_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + + @distributed_trace_async + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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, azure.core.polling.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._rotate_cluster_certificates_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + + @distributed_trace_async + async def begin_stop( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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, azure.core.polling.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._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + + @distributed_trace_async + async def begin_start( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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, azure.core.polling.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._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') + + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + + @distributed_trace_async + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> AsyncLROPoller["_models.RunCommandResult"]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param request_payload: The run command request. + :type request_payload: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] + lro_delay = kwargs.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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('RunCommandResult', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace_async + async def get_command_result( + self, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param command_id: Id of the command. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + + @distributed_trace + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..d8ebe1af8c0a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/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. +# -------------------------------------------------------------------------- +import functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request +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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..6495afe5af03 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,330 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_delete_request_initial, build_get_request, build_list_request, build_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations 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.containerservice.v2021_11_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 + + @distributed_trace_async + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in 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, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..1937ead46410 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations 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.containerservice.v2021_11_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 + + @distributed_trace_async + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..a627d64996c6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_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. +# -------------------------------------------------------------------------- +import functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResolvePrivateLinkServiceIdOperations: + """ResolvePrivateLinkServiceIdOperations 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.containerservice.v2021_11_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 + + @distributed_trace_async + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..31b5be97c880 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py @@ -0,0 +1,412 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._snapshots_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations: + """SnapshotsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotListResult"]: + """Gets a list of snapshots in the specified subscription. + + Gets a list of snapshots in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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.ContainerService/snapshots'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotListResult"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :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 SnapshotListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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.ContainerService/snapshots'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": + """Gets a snapshot. + + Gets a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The snapshot to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/__init__.py new file mode 100644 index 000000000000..4729140ec1d7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/__init__.py @@ -0,0 +1,259 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import CloudErrorBody +from ._models_py3 import ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import ContainerServiceVMDiagnostics +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterOIDCIssuerProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileAzureDefender +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import WindowsGmsaProfile + + +from ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + Code, + ConnectionStatus, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + CreatedByType, + Expander, + ExtendedLocationTypes, + GPUInstanceProfile, + IpFamily, + KubeletDiskType, + LicenseType, + LoadBalancerSku, + ManagedClusterPodIdentityProvisioningState, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSDiskType, + OSSKU, + OSType, + OutboundType, + PrivateEndpointConnectionProvisioningState, + PublicNetworkAccess, + ResourceIdentityType, + ScaleDownMode, + ScaleSetEvictionPolicy, + ScaleSetPriority, + SnapshotType, + UpgradeChannel, + WeekDay, + WorkloadRuntime, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CreationData', + 'CredentialResult', + 'CredentialResults', + 'EndpointDependency', + 'EndpointDetail', + 'ExtendedLocation', + 'KubeletConfig', + 'LinuxOSConfig', + 'MaintenanceConfiguration', + 'MaintenanceConfigurationListResult', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterAutoUpgradeProfile', + 'ManagedClusterHTTPProxyConfig', + 'ManagedClusterIdentity', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterManagedOutboundIPProfile', + 'ManagedClusterNATGatewayProfile', + 'ManagedClusterOIDCIssuerProfile', + 'ManagedClusterPodIdentity', + 'ManagedClusterPodIdentityException', + 'ManagedClusterPodIdentityProfile', + 'ManagedClusterPodIdentityProvisioningError', + 'ManagedClusterPodIdentityProvisioningErrorBody', + 'ManagedClusterPodIdentityProvisioningInfo', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterSKU', + 'ManagedClusterSecurityProfile', + 'ManagedClusterSecurityProfileAzureDefender', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'ManagedServiceIdentityUserAssignedIdentitiesValue', + 'OSOptionProfile', + 'OSOptionProperty', + 'OperationListResult', + 'OperationValue', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'PowerState', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceReference', + 'RunCommandRequest', + 'RunCommandResult', + 'Snapshot', + 'SnapshotListResult', + 'SubResource', + 'SysctlConfig', + 'SystemData', + 'TagsObject', + 'TimeInWeek', + 'TimeSpan', + 'UserAssignedIdentity', + 'WindowsGmsaProfile', + 'AgentPoolMode', + 'AgentPoolType', + 'Code', + 'ConnectionStatus', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'CreatedByType', + 'Expander', + 'ExtendedLocationTypes', + 'GPUInstanceProfile', + 'IpFamily', + 'KubeletDiskType', + 'LicenseType', + 'LoadBalancerSku', + 'ManagedClusterPodIdentityProvisioningState', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSDiskType', + 'OSSKU', + 'OSType', + 'OutboundType', + 'PrivateEndpointConnectionProvisioningState', + 'PublicNetworkAccess', + 'ResourceIdentityType', + 'ScaleDownMode', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', + 'SnapshotType', + 'UpgradeChannel', + 'WeekDay', + 'WorkloadRuntime', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_container_service_client_enums.py new file mode 100644 index 000000000000..feacacdf3147 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_container_service_client_enums.py @@ -0,0 +1,575 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class AgentPoolMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """A cluster must have at least one 'System' Agent Pool at all times. For additional information + on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools + """ + + #: System agent pools are primarily for hosting critical system pods such as CoreDNS and + #: metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + #: least 2vCPUs and 4GB of memory. + SYSTEM = "System" + #: User agent pools are primarily for hosting your application pods. + USER = "User" + +class AgentPoolType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of Agent Pool. + """ + + #: Create an Agent Pool backed by a Virtual Machine Scale Set. + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + #: Use of this is strongly discouraged. + AVAILABILITY_SET = "AvailabilitySet" + +class Code(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Tells whether the cluster is Running or Stopped + """ + + #: The cluster is running. + RUNNING = "Running" + #: The cluster is stopped. + STOPPED = "Stopped" + +class ConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The private link service connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class ContainerServiceStorageProfileTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf + based on the choice of orchestrator. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. Note: This is no longer maintained. + """ + + STANDARD_A1 = "Standard_A1" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2 = "Standard_A2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_A9 = "Standard_A9" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D11 = "Standard_D11" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D11_V2_PROMO = "Standard_D11_v2_Promo" + STANDARD_D12 = "Standard_D12" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D12_V2_PROMO = "Standard_D12_v2_Promo" + STANDARD_D13 = "Standard_D13" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D13_V2_PROMO = "Standard_D13_v2_Promo" + STANDARD_D14 = "Standard_D14" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D14_V2_PROMO = "Standard_D14_v2_Promo" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2 = "Standard_D2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D2_V2_PROMO = "Standard_D2_v2_Promo" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D3 = "Standard_D3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D3_V2_PROMO = "Standard_D3_v2_Promo" + STANDARD_D4 = "Standard_D4" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D4_V2_PROMO = "Standard_D4_v2_Promo" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D5_V2_PROMO = "Standard_D5_v2_Promo" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS11_V2_PROMO = "Standard_DS11_v2_Promo" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS12_V2_PROMO = "Standard_DS12_v2_Promo" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS13_V2_PROMO = "Standard_DS13_v2_Promo" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS14_V2_PROMO = "Standard_DS14_v2_Promo" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS2_V2_PROMO = "Standard_DS2_v2_Promo" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS3_V2_PROMO = "Standard_DS3_v2_Promo" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS4_V2_PROMO = "Standard_DS4_v2_Promo" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS5_V2_PROMO = "Standard_DS5_v2_Promo" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E32_16_S_V3 = "Standard_E32-16s_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F16 = "Standard_F16" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2 = "Standard_F2" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F4 = "Standard_F4" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8 = "Standard_F8" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H16 = "Standard_H16" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H8 = "Standard_H8" + STANDARD_H8_M = "Standard_H8m" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M64_S = "Standard_M64s" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" + STANDARD_NV6 = "Standard_NV6" + +class Count(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): + """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The + default value is 1. + """ + + ONE = 1 + THREE = 3 + FIVE = 5 + +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 Expander(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """If not specified, the default is 'random'. See `expanders + `_ + for more information. + """ + + #: Selects the node group that will have the least idle CPU (if tied, unused memory) after + #: scale-up. This is useful when you have different classes of nodes, for example, high CPU or + #: high memory nodes, and only want to expand those when there are pending pods that need a lot of + #: those resources. + LEAST_WASTE = "least-waste" + #: Selects the node group that would be able to schedule the most pods when scaling up. This is + #: useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + #: that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple + #: smaller nodes at once. + MOST_PODS = "most-pods" + #: Selects the node group that has the highest priority assigned by the user. It's configuration + #: is described in more details `here + #: `_. + PRIORITY = "priority" + #: Used when you don't have a particular need for the node groups to scale differently. + RANDOM = "random" + +class ExtendedLocationTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + +class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + """ + + MIG1_G = "MIG1g" + MIG2_G = "MIG2g" + MIG3_G = "MIG3g" + MIG4_G = "MIG4g" + MIG7_G = "MIG7g" + +class IpFamily(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The IP version to use for cluster networking and IP assignment. + """ + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + +class KubeletDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. + """ + + #: Kubelet will use the OS disk for its data. + OS = "OS" + #: Kubelet will use the temporary disk for its data. + TEMPORARY = "Temporary" + +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. + """ + + #: No additional licensing is applied. + NONE = "None" + #: Enables Azure Hybrid User Benefits for Windows VMs. + WINDOWS_SERVER = "Windows_Server" + +class LoadBalancerSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. + """ + + #: Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information + #: about on working with the load balancer in the managed cluster, see the `standard Load Balancer + #: `_ article. + STANDARD = "standard" + #: Use a basic Load Balancer with limited functionality. + BASIC = "basic" + +class ManagedClusterPodIdentityProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state of the pod identity. + """ + + ASSIGNED = "Assigned" + UPDATING = "Updating" + DELETING = "Deleting" + FAILED = "Failed" + +class ManagedClusterSKUName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. + """ + + #: Guarantees 99.95% availability of the Kubernetes API server endpoint for clusters that use + #: Availability Zones and 99.9% of availability for clusters that don't use Availability Zones. + PAID = "Paid" + #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. + FREE = "Free" + +class NetworkMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """This cannot be specified if networkPlugin is anything other than 'azure'. + """ + + #: No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + #: CNI. See `Transparent Mode `_ for + #: more information. + TRANSPARENT = "transparent" + #: This is no longer supported. + BRIDGE = "bridge" + +class NetworkPlugin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Network plugin used for building the Kubernetes network. + """ + + #: Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + #: `_ for + #: more information. + AZURE = "azure" + #: Use the Kubenet network plugin. See `Kubenet (basic) networking + #: `_ for more + #: information. + KUBENET = "kubenet" + +class NetworkPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Network policy used for building the Kubernetes network. + """ + + #: Use Calico network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + CALICO = "calico" + #: Use Azure network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + AZURE = "azure" + +class OSDiskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested + OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more + information see `Ephemeral OS + `_. + """ + + #: Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data + #: loss should the VM need to be relocated to another host. Since containers aren't designed to + #: have local state persisted, this behavior offers limited value while providing some drawbacks, + #: including slower node provisioning and higher read/write latency. + MANAGED = "Managed" + #: Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This + #: provides lower read/write latency, along with faster node scaling and cluster upgrades. + EPHEMERAL = "Ephemeral" + +class OSSKU(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Specifies an OS SKU. This value must not be specified if OSType is Windows. + """ + + UBUNTU = "Ubuntu" + CBL_MARINER = "CBLMariner" + +class OSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The operating system type. The default is Linux. + """ + + #: Use Linux. + LINUX = "Linux" + #: Use Windows. + WINDOWS = "Windows" + +class OutboundType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """This can only be set at cluster creation time and cannot be changed later. For more information + see `egress outbound type `_. + """ + + #: The load balancer is used for egress through an AKS assigned public IP. This supports + #: Kubernetes services of type 'loadBalancer'. For more information see `outbound type + #: loadbalancer + #: `_. + LOAD_BALANCER = "loadBalancer" + #: Egress paths must be defined by the user. This is an advanced scenario and requires proper + #: network configuration. For more information see `outbound type userDefinedRouting + #: `_. + USER_DEFINED_ROUTING = "userDefinedRouting" + #: The AKS-managed NAT gateway is used for egress. + MANAGED_NAT_GATEWAY = "managedNATGateway" + #: The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + #: advanced scenario and requires proper network configuration. + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PublicNetworkAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Allow or deny public network access for AKS + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """For more information see `use managed identities in AKS + `_. + """ + + #: Use an implicitly created system assigned managed identity to manage cluster resources. Master + #: components in the control plane such as kube-controller-manager will use the system assigned + #: managed identity to manipulate Azure resources. + SYSTEM_ASSIGNED = "SystemAssigned" + #: Use a user-specified identity to manage cluster resources. Master components in the control + #: plane such as kube-controller-manager will use the specified user assigned managed identity to + #: manipulate Azure resources. + USER_ASSIGNED = "UserAssigned" + #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. + NONE = "None" + +class ScaleDownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + #: Create new instances during scale up and remove instances during scale down. + DELETE = "Delete" + #: Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + #: during scale down. + DEALLOCATE = "Deallocate" + +class ScaleSetEvictionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. + For more information about eviction see `spot VMs + `_ + """ + + #: Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. + DELETE = "Delete" + #: Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state + #: upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can + #: cause issues with cluster scaling or upgrading. + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The Virtual Machine Scale Set priority. + """ + + #: Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + #: `_ for more information. + SPOT = "Spot" + #: Regular VMs will be used. + REGULAR = "Regular" + +class SnapshotType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of a snapshot. The default is NodePool. + """ + + #: The snapshot is a snapshot of a node pool. + NODE_POOL = "NodePool" + +class UpgradeChannel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """For more information see `setting the AKS cluster auto-upgrade channel + `_. + """ + + #: Automatically upgrade the cluster to the latest supported patch release on the latest supported + #: minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor + #: version where N is the latest supported minor version, the cluster first upgrades to the latest + #: supported patch version on N-1 minor version. For example, if a cluster is running version + #: 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is + #: upgraded to 1.18.6, then is upgraded to 1.19.1. + RAPID = "rapid" + #: Automatically upgrade the cluster to the latest supported patch release on minor version N-1, + #: where N is the latest supported minor version. For example, if a cluster is running version + #: 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded + #: to 1.18.6. + STABLE = "stable" + #: Automatically upgrade the cluster to the latest supported patch version when it becomes + #: available while keeping the minor version the same. For example, if a cluster is running + #: version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is + #: upgraded to 1.17.9. + PATCH = "patch" + #: Automatically upgrade the node image to the latest version available. Microsoft provides + #: patches and new images for image nodes frequently (usually weekly), but your running nodes + #: won't get the new images unless you do a node image upgrade. Turning on the node-image channel + #: will automatically update your node images whenever a new version is available. + NODE_IMAGE = "node-image" + #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + NONE = "none" + +class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The weekday enum. + """ + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class WorkloadRuntime(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Determines the type of workload a node can run. + """ + + #: Nodes will use Kubelet to run standard OCI container workloads. + OCI_CONTAINER = "OCIContainer" + #: Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + WASM_WASI = "WasmWasi" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..2f8ad968608a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py @@ -0,0 +1,5946 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 ._container_service_client_enums import * + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :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(SubResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): + """Agent Pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :vartype os_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WorkloadRuntime + :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after + decoding. This allows customization of the message of the day for Linux nodes. It must not be + specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be + executed as a script). + :vartype message_of_the_day: str + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :vartype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleDownMode + :ivar type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :vartype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :vartype mode: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and + does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :vartype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetPriority + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :vartype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetEvictionPolicy + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_11_01_preview.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :vartype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.GPUInstanceProfile + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the + Capacity Reservation Group. + :vartype capacity_reservation_group_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, + 'message_of_the_day': {'key': 'properties.messageOfTheDay', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, + 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, + 'min_count': {'key': 'properties.minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'capacity_reservation_group_id': {'key': 'properties.capacityReservationGroupID', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + power_state: Optional["PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + **kwargs + ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WorkloadRuntime + :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after + decoding. This allows customization of the message of the day for Linux nodes. It must not be + specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be + executed as a script). + :paramtype message_of_the_day: str + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleDownMode + :keyword type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the + Capacity Reservation Group. + :paramtype capacity_reservation_group_id: str + """ + super(AgentPool, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type_properties_type = type_properties_type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + + +class AgentPoolAvailableVersions(msrest.serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + _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'}, + 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, + } + + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + super(AgentPoolAvailableVersions, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = agent_pool_versions + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + 'default': {'key': 'default', 'type': 'bool'}, + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) + self.default = default + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolListResult(msrest.serialization.Model): + """The response from the List Agent Pools operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of agent pools. + :vartype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool] + """ + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AgentPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only 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 ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, + 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs + ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword latest_node_image_version: The latest AKS supported node image version. + :paramtype latest_node_image_version: str + """ + super(AgentPoolUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kubernetes_version = kubernetes_version + self.os_type = os_type + self.upgrades = upgrades + self.latest_node_image_version = latest_node_image_version + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolUpgradeSettings(msrest.serialization.Model): + """Settings for upgrading an agentpool. + + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + If a percentage is specified, it is the percentage of the total agent pool size at the time of + the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :vartype max_surge: str + """ + + _attribute_map = { + 'max_surge': {'key': 'maxSurge', 'type': 'str'}, + } + + def __init__( + self, + *, + max_surge: Optional[str] = None, + **kwargs + ): + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the + time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the + default is 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: str + """ + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container service. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.CloudErrorBody] + """ + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): + """Profile for diagnostics on the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :ivar vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :vartype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceVMDiagnostics + """ + + _validation = { + 'vm_diagnostics': {'required': True}, + } + + _attribute_map = { + 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, + } + + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): + """ + :keyword vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceVMDiagnostics + """ + super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) + self.vm_diagnostics = vm_diagnostics + + +class ContainerServiceLinuxProfile(msrest.serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :ivar admin_username: Required. The administrator username to use for Linux VMs. + :vartype admin_username: str + :ivar ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :vartype ssh: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceSshConfiguration + """ + + _validation = { + 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, + 'ssh': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, + } + + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): + """ + :keyword admin_username: Required. The administrator username to use for Linux VMs. + :paramtype admin_username: str + :keyword ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :paramtype ssh: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceSshConfiguration + """ + super(ContainerServiceLinuxProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.ssh = ssh + + +class ContainerServiceMasterProfile(msrest.serialization.Model): + """Profile for the container service master. + + Variables are only 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 count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :vartype count: int or ~azure.mgmt.containerservice.v2021_11_01_preview.models.Count + :ivar dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :vartype dns_prefix: str + :ivar vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :vartype vm_size: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceVMSizeTypes + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :vartype storage_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceStorageProfileTypes + :ivar fqdn: FQDN for the master pool. + :vartype fqdn: str + """ + + _validation = { + 'dns_prefix': {'required': True}, + 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + dns_prefix: str, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + count: Optional[Union[int, "Count"]] = 1, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + first_consecutive_static_ip: Optional[str] = "10.240.255.5", + storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, + **kwargs + ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :paramtype count: int or ~azure.mgmt.containerservice.v2021_11_01_preview.models.Count + :keyword dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :paramtype dns_prefix: str + :keyword vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceStorageProfileTypes + """ + super(ContainerServiceMasterProfile, self).__init__(**kwargs) + self.count = count + self.dns_prefix = dns_prefix + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.first_consecutive_static_ip = first_consecutive_static_ip + self.storage_profile = storage_profile + self.fqdn = None + + +class ContainerServiceNetworkProfile(msrest.serialization.Model): + """Profile of network configuration. + + :ivar network_plugin: Network plugin used for building the Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :vartype network_plugin: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.NetworkPlugin + :ivar network_policy: Network policy used for building the Kubernetes network. Possible values + include: "calico", "azure". + :vartype network_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.NetworkPolicy + :ivar network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + Possible values include: "transparent", "bridge". + :vartype network_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.NetworkMode + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :vartype dns_service_ip: str + :ivar docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :vartype docker_bridge_cidr: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :vartype outbound_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OutboundType + :ivar load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :vartype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfile + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterNATGatewayProfile + :ivar pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each + IP family (IPv4/IPv6), is expected for dual-stack networking. + :vartype pod_cidrs: list[str] + :ivar service_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for + each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with + any Subnet IP ranges. + :vartype service_cidrs: list[str] + :ivar ip_families: IP families are used to determine single-stack or dual-stack clusters. For + single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and + IPv6. + :vartype ip_families: list[str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.IpFamily] + """ + + _validation = { + 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, + 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + } + + _attribute_map = { + 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, + 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, + 'network_mode': {'key': 'networkMode', 'type': 'str'}, + 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, + 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'outbound_type': {'key': 'outboundType', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, + 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, + 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, + 'pod_cidrs': {'key': 'podCidrs', 'type': '[str]'}, + 'service_cidrs': {'key': 'serviceCidrs', 'type': '[str]'}, + 'ip_families': {'key': 'ipFamilies', 'type': '[str]'}, + } + + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "NetworkMode"]] = None, + pod_cidr: Optional[str] = "10.244.0.0/16", + service_cidr: Optional[str] = "10.0.0.0/16", + dns_service_ip: Optional[str] = "10.0.0.10", + docker_bridge_cidr: Optional[str] = "172.17.0.1/16", + outbound_type: Optional[Union[str, "OutboundType"]] = "loadBalancer", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["ManagedClusterNATGatewayProfile"] = None, + pod_cidrs: Optional[List[str]] = None, + service_cidrs: Optional[List[str]] = None, + ip_families: Optional[List[Union[str, "IpFamily"]]] = None, + **kwargs + ): + """ + :keyword network_plugin: Network plugin used for building the Kubernetes network. Possible + values include: "azure", "kubenet". Default value: "kubenet". + :paramtype network_plugin: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.NetworkPlugin + :keyword network_policy: Network policy used for building the Kubernetes network. Possible + values include: "calico", "azure". + :paramtype network_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.NetworkPolicy + :keyword network_mode: This cannot be specified if networkPlugin is anything other than + 'azure'. Possible values include: "transparent", "bridge". + :paramtype network_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.NetworkMode + :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :paramtype pod_cidr: str + :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :paramtype outbound_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OutboundType + :keyword load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :paramtype load_balancer_sku: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterNATGatewayProfile + :keyword pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for + each IP family (IPv4/IPv6), is expected for dual-stack networking. + :paramtype pod_cidrs: list[str] + :keyword service_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one + for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap + with any Subnet IP ranges. + :paramtype service_cidrs: list[str] + :keyword ip_families: IP families are used to determine single-stack or dual-stack clusters. + For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and + IPv6. + :paramtype ip_families: list[str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.IpFamily] + """ + super(ContainerServiceNetworkProfile, self).__init__(**kwargs) + self.network_plugin = network_plugin + self.network_policy = network_policy + self.network_mode = network_mode + self.pod_cidr = pod_cidr + self.service_cidr = service_cidr + self.dns_service_ip = dns_service_ip + self.docker_bridge_cidr = docker_bridge_cidr + self.outbound_type = outbound_type + self.load_balancer_sku = load_balancer_sku + self.load_balancer_profile = load_balancer_profile + self.nat_gateway_profile = nat_gateway_profile + self.pod_cidrs = pod_cidrs + self.service_cidrs = service_cidrs + self.ip_families = ip_families + + +class ContainerServiceSshConfiguration(msrest.serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to Azure. + + :ivar public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + VMs. A maximum of 1 key may be specified. + :vartype public_keys: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceSshPublicKey] + """ + + _validation = { + 'public_keys': {'required': True}, + } + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, + } + + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): + """ + :keyword public_keys: Required. The list of SSH public keys used to authenticate with + Linux-based VMs. A maximum of 1 key may be specified. + :paramtype public_keys: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceSshPublicKey] + """ + super(ContainerServiceSshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys + + +class ContainerServiceSshPublicKey(msrest.serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to Azure. + + :ivar key_data: Required. Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. + :vartype key_data: str + """ + + _validation = { + 'key_data': {'required': True}, + } + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__( + self, + *, + key_data: str, + **kwargs + ): + """ + :keyword key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :paramtype key_data: str + """ + super(ContainerServiceSshPublicKey, self).__init__(**kwargs) + self.key_data = key_data + + +class ContainerServiceVMDiagnostics(msrest.serialization.Model): + """Profile for diagnostics on the container service VMs. + + Variables are only 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 enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :vartype enabled: bool + :ivar storage_uri: The URI of the storage account where diagnostics are stored. + :vartype storage_uri: str + """ + + _validation = { + 'enabled': {'required': True}, + 'storage_uri': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: bool, + **kwargs + ): + """ + :keyword enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :paramtype enabled: bool + """ + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = None + + +class CreationData(msrest.serialization.Model): + """Data used when creating a target resource from a source resource. + + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :vartype source_resource_id: str + """ + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + source_resource_id: Optional[str] = None, + **kwargs + ): + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ + super(CreationData, self).__init__(**kwargs) + self.source_resource_id = source_resource_id + + +class CredentialResult(msrest.serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytearray + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CredentialResult, self).__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(msrest.serialization.Model): + """The list credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. + :vartype kubeconfigs: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResult] + """ + + _validation = { + 'kubeconfigs': {'readonly': True}, + } + + _attribute_map = { + 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CredentialResults, self).__init__(**kwargs) + self.kubeconfigs = None + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.EndpointDetail] + """ + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. Possible values include: "EdgeZone". + :vartype type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. Possible values include: "EdgeZone". + :paramtype type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ExtendedLocationTypes + """ + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class KubeletConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int + """ + + _validation = { + 'container_log_max_files': {'minimum': 2}, + } + + _attribute_map = { + 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, + 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, + 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, + 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, + 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, + 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, + 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, + 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, + 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, + 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, + 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, + } + + def __init__( + self, + *, + cpu_manager_policy: Optional[str] = None, + cpu_cfs_quota: Optional[bool] = None, + cpu_cfs_quota_period: Optional[str] = None, + image_gc_high_threshold: Optional[int] = None, + image_gc_low_threshold: Optional[int] = None, + topology_manager_policy: Optional[str] = None, + allowed_unsafe_sysctls: Optional[List[str]] = None, + fail_swap_on: Optional[bool] = None, + container_log_max_size_mb: Optional[int] = None, + container_log_max_files: Optional[int] = None, + pod_max_pids: Optional[int] = None, + **kwargs + ): + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ + super(KubeletConfig, self).__init__(**kwargs) + self.cpu_manager_policy = cpu_manager_policy + self.cpu_cfs_quota = cpu_cfs_quota + self.cpu_cfs_quota_period = cpu_cfs_quota_period + self.image_gc_high_threshold = image_gc_high_threshold + self.image_gc_low_threshold = image_gc_low_threshold + self.topology_manager_policy = topology_manager_policy + self.allowed_unsafe_sysctls = allowed_unsafe_sysctls + self.fail_swap_on = fail_swap_on + self.container_log_max_size_mb = container_log_max_size_mb + self.container_log_max_files = container_log_max_files + self.pod_max_pids = pod_max_pids + + +class LinuxOSConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2021_11_01_preview.models.SysctlConfig + :ivar transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int + """ + + _attribute_map = { + 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, + 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, + 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, + 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, + } + + def __init__( + self, + *, + sysctls: Optional["SysctlConfig"] = None, + transparent_huge_page_enabled: Optional[str] = None, + transparent_huge_page_defrag: Optional[str] = None, + swap_file_size_mb: Optional[int] = None, + **kwargs + ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2021_11_01_preview.models.SysctlConfig + :keyword transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ + super(LinuxOSConfig, self).__init__(**kwargs) + self.sysctls = sysctls + self.transparent_huge_page_enabled = transparent_huge_page_enabled + self.transparent_huge_page_defrag = transparent_huge_page_defrag + self.swap_file_size_mb = swap_file_size_mb + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more information about planned maintenance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.SystemData + :ivar time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :vartype time_in_week: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.TimeSpan] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, + 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["TimeInWeek"]] = None, + not_allowed_time: Optional[List["TimeSpan"]] = None, + **kwargs + ): + """ + :keyword time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :paramtype time_in_week: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.TimeSpan] + """ + super(MaintenanceConfiguration, self).__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + + +class MaintenanceConfigurationListResult(msrest.serialization.Model): + """The response from the List maintenance configurations operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of maintenance configurations. + :vartype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MaintenanceConfiguration"]] = None, + **kwargs + ): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration] + """ + super(MaintenanceConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ManagedCluster(Resource): + """Managed cluster. + + Variables are only 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterIdentity + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + :ivar power_state: The Power State of the cluster. + :vartype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :ivar max_agent_pools: The max number of agent pools for the managed cluster. + :vartype max_agent_pools: int + :ivar kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + cannot be skipped. All upgrades must be performed sequentially by major version number. For + example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :vartype kubernetes_version: str + :ivar current_kubernetes_version: The version of Kubernetes the Managed Cluster is running. + :vartype current_kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAgentPoolProfile] + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceLinuxProfile + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterWindowsProfile + :ivar service_principal_profile: Information about a service principal identity for the cluster + to use for manipulating Azure APIs. + :vartype service_principal_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterServicePrincipalProfile + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAddonProfile] + :ivar pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :vartype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProfile + :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :vartype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterOIDCIssuerProfile + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :vartype enable_pod_security_policy: bool + :ivar enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updation of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :vartype enable_namespace_resources: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceNetworkProfile + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAutoUpgradeProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPropertiesAutoScalerProfile + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAPIServerAccessProfile + :ivar disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_11_01_preview.models.UserAssignedIdentity] + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource] + :ivar disable_local_accounts: If set to true, getting static credentials will be disabled for + this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details + see `disable local accounts + `_. + :vartype disable_local_accounts: bool + :ivar http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :vartype http_proxy_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterHTTPProxyConfig + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSecurityProfile + :ivar public_network_access: Allow or deny public network access for AKS. Possible values + include: "Enabled", "Disabled". + :vartype public_network_access: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'current_kubernetes_version': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, + 'azure_portal_fqdn': {'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': 'ManagedClusterSKU'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'current_kubernetes_version': {'key': 'properties.currentKubernetesVersion', 'type': 'str'}, + 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, + 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, + 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, + 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, + 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, + 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, + 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, + 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, + 'oidc_issuer_profile': {'key': 'properties.oidcIssuerProfile', 'type': 'ManagedClusterOIDCIssuerProfile'}, + 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, + 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, + 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, + 'enable_namespace_resources': {'key': 'properties.enableNamespaceResources', 'type': 'bool'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, + 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, + 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, + 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, + 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, + 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, + 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, + 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + extended_location: Optional["ExtendedLocation"] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[List["ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["ManagedClusterPodIdentityProfile"] = None, + oidc_issuer_profile: Optional["ManagedClusterOIDCIssuerProfile"] = None, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + enable_namespace_resources: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + auto_upgrade_profile: Optional["ManagedClusterAutoUpgradeProfile"] = None, + auto_scaler_profile: Optional["ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "UserAssignedIdentity"]] = None, + private_link_resources: Optional[List["PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["ManagedClusterSecurityProfile"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + **kwargs + ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterIdentity + :keyword kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor + versions cannot be skipped. All upgrades must be performed sequentially by major version + number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterWindowsProfile + :keyword service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :paramtype service_principal_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAddonProfile] + :keyword pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :paramtype pod_identity_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProfile + :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :paramtype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterOIDCIssuerProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updation of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :paramtype enable_namespace_resources: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPropertiesAutoScalerProfile + :keyword api_server_access_profile: The access profile for managed cluster API server. + :paramtype api_server_access_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_11_01_preview.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource] + :keyword disable_local_accounts: If set to true, getting static credentials will be disabled + for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + details see `disable local accounts + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSecurityProfile + :keyword public_network_access: Allow or deny public network access for AKS. Possible values + include: "Enabled", "Disabled". + :paramtype public_network_access: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PublicNetworkAccess + """ + super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.extended_location = extended_location + self.identity = identity + self.provisioning_state = None + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.current_kubernetes_version = None + self.dns_prefix = dns_prefix + self.fqdn_subdomain = fqdn_subdomain + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = agent_pool_profiles + self.linux_profile = linux_profile + self.windows_profile = windows_profile + self.service_principal_profile = service_principal_profile + self.addon_profiles = addon_profiles + self.pod_identity_profile = pod_identity_profile + self.oidc_issuer_profile = oidc_issuer_profile + self.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.enable_namespace_resources = enable_namespace_resources + self.network_profile = network_profile + self.aad_profile = aad_profile + self.auto_upgrade_profile = auto_upgrade_profile + self.auto_scaler_profile = auto_scaler_profile + self.api_server_access_profile = api_server_access_profile + self.disk_encryption_set_id = disk_encryption_set_id + self.identity_profile = identity_profile + self.private_link_resources = private_link_resources + self.disable_local_accounts = disable_local_accounts + self.http_proxy_config = http_proxy_config + self.security_profile = security_profile + self.public_network_access = public_network_access + + +class ManagedClusterAADProfile(msrest.serialization.Model): + """For more details see `managed AAD on AKS `_. + + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :vartype tenant_id: str + """ + + _attribute_map = { + 'managed': {'key': 'managed', 'type': 'bool'}, + 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, + 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, + 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, + 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantID', 'type': 'str'}, + } + + def __init__( + self, + *, + managed: Optional[bool] = None, + enable_azure_rbac: Optional[bool] = None, + admin_group_object_i_ds: Optional[List[str]] = None, + client_app_id: Optional[str] = None, + server_app_id: Optional[str] = None, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ + super(ManagedClusterAADProfile, self).__init__(**kwargs) + self.managed = managed + self.enable_azure_rbac = enable_azure_rbac + self.admin_group_object_i_ds = admin_group_object_i_ds + self.client_app_id = client_app_id + self.server_app_id = server_app_id + self.server_app_secret = server_app_secret + self.tenant_id = tenant_id + + +class ManagedClusterAccessProfile(Resource): + """Managed cluster Access Profile. + + Variables are only 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytearray + """ + super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) + self.kube_config = kube_config + + +class ManagedClusterAddonProfile(msrest.serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only 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 enabled: Required. Whether the add-on is enabled or not. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + } + + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword enabled: Required. Whether the add-on is enabled or not. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = enabled + self.config = config + self.identity = None + + +class UserAssignedIdentity(msrest.serialization.Model): + """Details about a user assigned identity. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ + super(UserAssignedIdentity, self).__init__(**kwargs) + self.resource_id = resource_id + self.client_id = client_id + self.object_id = object_id + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ + super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) + + +class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :vartype os_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WorkloadRuntime + :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after + decoding. This allows customization of the message of the day for Linux nodes. It must not be + specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be + executed as a script). + :vartype message_of_the_day: str + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :vartype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :vartype type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :vartype mode: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and + does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :vartype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetPriority + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :vartype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetEvictionPolicy + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_11_01_preview.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :vartype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.GPUInstanceProfile + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the + Capacity Reservation Group. + :vartype capacity_reservation_group_id: str + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'message_of_the_day': {'key': 'messageOfTheDay', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + 'capacity_reservation_group_id': {'key': 'capacityReservationGroupID', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + power_state: Optional["PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + **kwargs + ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WorkloadRuntime + :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after + decoding. This allows customization of the message of the day for Linux nodes. It must not be + specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be + executed as a script). + :paramtype message_of_the_day: str + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the + Capacity Reservation Group. + :paramtype capacity_reservation_group_id: str + """ + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + + +class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): + """Profile for the container service agent pool. + + Variables are only 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + the vmSize specified. + :vartype os_disk_size_gb: int + :ivar os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :vartype os_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSDiskType + :ivar kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :vartype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WorkloadRuntime + :ivar message_of_the_day: A base64-encoded string which will be written to /etc/motd after + decoding. This allows customization of the message of the day for Linux nodes. It must not be + specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be + executed as a script). + :vartype message_of_the_day: str + :ivar vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :vartype vnet_subnet_id: str + :ivar pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :ivar max_count: The maximum number of nodes for auto-scaling. + :vartype max_count: int + :ivar min_count: The minimum number of nodes for auto-scaling. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :vartype enable_auto_scaling: bool + :ivar scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :vartype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleDownMode + :ivar type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :vartype type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolType + :ivar mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :vartype mode: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolMode + :ivar orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: When an Agent Pool is first created it is initially Running. The Agent Pool + can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and + does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :vartype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :ivar availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :vartype availability_zones: list[str] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :vartype node_public_ip_prefix_id: str + :ivar scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the default + is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :vartype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetPriority + :ivar scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :vartype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetEvictionPolicy + :ivar spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :vartype spot_max_price: float + :ivar tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2021_11_01_preview.models.LinuxOSConfig + :ivar enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :ivar gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :vartype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.GPUInstanceProfile + :ivar creation_data: CreationData to be used to specify the source Snapshot ID if the node pool + will be created/upgraded using a snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :ivar capacity_reservation_group_id: AKS will associate the specified agent pool with the + Capacity Reservation Group. + :vartype capacity_reservation_group_id: str + :ivar name: Required. Windows agent pool names must be 6 characters or less. + :vartype name: str + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'message_of_the_day': {'key': 'messageOfTheDay', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + 'capacity_reservation_group_id': {'key': 'capacityReservationGroupID', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + power_state: Optional["PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + **kwargs + ): + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :paramtype os_disk_size_gb: int + :keyword os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :paramtype os_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSDiskType + :keyword kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime + data root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :paramtype kubelet_disk_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WorkloadRuntime + :keyword message_of_the_day: A base64-encoded string which will be written to /etc/motd after + decoding. This allows customization of the message of the day for Linux nodes. It must not be + specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be + executed as a script). + :paramtype message_of_the_day: str + :keyword vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and + used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to + just nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype vnet_subnet_id: str + :keyword pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :keyword os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :keyword max_count: The maximum number of nodes for auto-scaling. + :paramtype max_count: int + :keyword min_count: The minimum number of nodes for auto-scaling. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :keyword scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, + it defaults to Delete. Possible values include: "Delete", "Deallocate". + :paramtype scale_down_mode: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleDownMode + :keyword type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolType + :keyword mode: A cluster must have at least one 'System' Agent Pool at all times. For + additional information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolMode + :keyword orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeSettings + :keyword power_state: When an Agent Pool is first created it is initially Running. The Agent + Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs + and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and + provisioning state is Succeeded. + :paramtype power_state: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PowerState + :keyword availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :paramtype availability_zones: list[str] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + their own dedicated public IP addresses. A common scenario is for gaming workloads, where a + console needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :paramtype node_public_ip_prefix_id: str + :keyword scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :paramtype scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetPriority + :keyword scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :paramtype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ScaleSetEvictionPolicy + :keyword spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :paramtype spot_max_price: float + :keyword tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword proximity_placement_group_id: The ID for Proximity Placement Group. + :paramtype proximity_placement_group_id: str + :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. + :paramtype kubelet_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LinuxOSConfig + :keyword enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance + profile for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", + "MIG7g". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.GPUInstanceProfile + :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :keyword capacity_reservation_group_id: AKS will associate the specified agent pool with the + Capacity Reservation Group. + :paramtype capacity_reservation_group_id: str + :keyword name: Required. Windows agent pool names must be 6 characters or less. + :paramtype name: str + """ + super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, workload_runtime=workload_runtime, message_of_the_day=message_of_the_day, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, power_state=power_state, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, creation_data=creation_data, capacity_reservation_group_id=capacity_reservation_group_id, **kwargs) + self.name = name + + +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): + """Access profile for managed cluster API server. + + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :vartype enable_private_cluster_public_fqdn: bool + :ivar disable_run_command: Whether to disable run command for the cluster or not. + :vartype disable_run_command: bool + """ + + _attribute_map = { + 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, + 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, + 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, + 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, + 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, + } + + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + private_dns_zone: Optional[str] = None, + enable_private_cluster_public_fqdn: Optional[bool] = None, + disable_run_command: Optional[bool] = None, + **kwargs + ): + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :paramtype enable_private_cluster_public_fqdn: bool + :keyword disable_run_command: Whether to disable run command for the cluster or not. + :paramtype disable_run_command: bool + """ + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + self.private_dns_zone = private_dns_zone + self.enable_private_cluster_public_fqdn = enable_private_cluster_public_fqdn + self.disable_run_command = disable_run_command + + +class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): + """Auto upgrade profile for a managed cluster. + + :ivar upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + `_. Possible + values include: "rapid", "stable", "patch", "node-image", "none". + :vartype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.UpgradeChannel + """ + + _attribute_map = { + 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, + } + + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, + **kwargs + ): + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Possible values include: "rapid", "stable", "patch", "node-image", "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.UpgradeChannel + """ + super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) + self.upgrade_channel = upgrade_channel + + +class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): + """Cluster HTTP proxy configuration. + + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str + """ + + _attribute_map = { + 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, + 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, + 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, + 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, + } + + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs + ): + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ + super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.trusted_ca = trusted_ca + + +class ManagedClusterIdentity(msrest.serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :ivar type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :vartype type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, + **kwargs + ): + """ + :keyword type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :paramtype type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ManagedClusterListResult(msrest.serialization.Model): + """The response from the List Managed Clusters operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of managed clusters. + :vartype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedCluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster] + """ + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): + """Profile of the managed cluster load balancer. + + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :vartype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + :ivar allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :vartype allocated_outbound_ports: int + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :vartype enable_multiple_standard_load_balancers: bool + """ + + _validation = { + 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, + } + + def __init__( + self, + *, + managed_outbound_i_ps: Optional["ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, + outbound_ip_prefixes: Optional["ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, + outbound_i_ps: Optional["ManagedClusterLoadBalancerProfileOutboundIPs"] = None, + effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, + allocated_outbound_ports: Optional[int] = 0, + idle_timeout_in_minutes: Optional[int] = 30, + enable_multiple_standard_load_balancers: Optional[bool] = None, + **kwargs + ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :paramtype outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :paramtype allocated_outbound_ports: int + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + """ + super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) + self.managed_outbound_i_ps = managed_outbound_i_ps + self.outbound_ip_prefixes = outbound_ip_prefixes + self.outbound_i_ps = outbound_i_ps + self.effective_outbound_i_ps = effective_outbound_i_ps + self.allocated_outbound_ports = allocated_outbound_ports + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_multiple_standard_load_balancers = enable_multiple_standard_load_balancers + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): + """Desired managed outbound IPs for the cluster load balancer. + + :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :vartype count: int + :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :vartype count_ipv6: int + """ + + _validation = { + 'count': {'maximum': 100, 'minimum': 1}, + 'count_ipv6': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'count_ipv6': {'key': 'countIPv6', 'type': 'int'}, + } + + def __init__( + self, + *, + count: Optional[int] = 1, + count_ipv6: Optional[int] = 0, + **kwargs + ): + """ + :keyword count: The desired number of IPv4 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. + :paramtype count: int + :keyword count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :paramtype count_ipv6: int + """ + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = count + self.count_ipv6 = count_ipv6 + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): + """Desired outbound IP Prefix resources for the cluster load balancer. + + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + """ + + _attribute_map = { + 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + """ + super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) + self.public_ip_prefixes = public_ip_prefixes + + +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): + """Desired outbound IP resources for the cluster load balancer. + + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + """ + + _attribute_map = { + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + """ + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + + +class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :vartype count: int + """ + + _validation = { + 'count': {'maximum': 16, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ + super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) + self.count = count + + +class ManagedClusterNATGatewayProfile(msrest.serialization.Model): + """Profile of the managed cluster NAT gateway. + + :ivar managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + NAT gateway. + :vartype managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterManagedOutboundIPProfile + :ivar effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :vartype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + :ivar idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :vartype idle_timeout_in_minutes: int + """ + + _validation = { + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["ManagedClusterManagedOutboundIPProfile"] = None, + effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, + idle_timeout_in_minutes: Optional[int] = 4, + **kwargs + ): + """ + :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the + cluster NAT gateway. + :paramtype managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ResourceReference] + :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :paramtype idle_timeout_in_minutes: int + """ + super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) + self.managed_outbound_ip_profile = managed_outbound_ip_profile + self.effective_outbound_i_ps = effective_outbound_i_ps + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class ManagedClusterOIDCIssuerProfile(msrest.serialization.Model): + """The OIDC issuer profile of the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar issuer_url: The OIDC issuer url of the Managed Cluster. + :vartype issuer_url: str + :ivar enabled: Whether the OIDC issuer is enabled. + :vartype enabled: bool + """ + + _validation = { + 'issuer_url': {'readonly': True}, + } + + _attribute_map = { + 'issuer_url': {'key': 'issuerURL', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + """ + :keyword enabled: Whether the OIDC issuer is enabled. + :paramtype enabled: bool + """ + super(ManagedClusterOIDCIssuerProfile, self).__init__(**kwargs) + self.issuer_url = None + self.enabled = enabled + + +class ManagedClusterPodIdentity(msrest.serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only 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 name: Required. The name of the pod identity. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity. + :vartype namespace: str + :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :vartype binding_selector: str + :ivar identity: Required. The user assigned identity details. + :vartype identity: ~azure.mgmt.containerservice.v2021_11_01_preview.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Possible values + include: "Assigned", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'identity': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'provisioning_info': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + identity: "UserAssignedIdentity", + binding_selector: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Required. The name of the pod identity. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity. + :paramtype namespace: str + :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :paramtype binding_selector: str + :keyword identity: Required. The user assigned identity details. + :paramtype identity: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.UserAssignedIdentity + """ + super(ManagedClusterPodIdentity, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.binding_selector = binding_selector + self.identity = identity + self.provisioning_state = None + self.provisioning_info = None + + +class ManagedClusterPodIdentityException(msrest.serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. The name of the pod identity exception. + :vartype name: str + :ivar namespace: Required. The namespace of the pod identity exception. + :vartype namespace: str + :ivar pod_labels: Required. The pod labels to match. + :vartype pod_labels: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'pod_labels': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + pod_labels: Dict[str, str], + **kwargs + ): + """ + :keyword name: Required. The name of the pod identity exception. + :paramtype name: str + :keyword namespace: Required. The namespace of the pod identity exception. + :paramtype namespace: str + :keyword pod_labels: Required. The pod labels to match. + :paramtype pod_labels: dict[str, str] + """ + super(ManagedClusterPodIdentityException, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.pod_labels = pod_labels + + +class ManagedClusterPodIdentityProfile(msrest.serialization.Model): + """See `use AAD pod identity `_ for more details on pod identity integration. + + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :ivar allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :vartype allow_network_plugin_kubenet: bool + :ivar user_assigned_identities: The pod identities to use in the cluster. + :vartype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentity] + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, + 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + allow_network_plugin_kubenet: Optional[bool] = None, + user_assigned_identities: Optional[List["ManagedClusterPodIdentity"]] = None, + user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, + **kwargs + ): + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :keyword allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :paramtype allow_network_plugin_kubenet: bool + :keyword user_assigned_identities: The pod identities to use in the cluster. + :paramtype user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityException] + """ + super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) + self.enabled = enabled + self.allow_network_plugin_kubenet = allow_network_plugin_kubenet + self.user_assigned_identities = user_assigned_identities + self.user_assigned_identity_exceptions = user_assigned_identity_exceptions + + +class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :ivar error: Details about the error. + :vartype error: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, + } + + def __init__( + self, + *, + error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, + **kwargs + ): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + **kwargs + ): + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): + """ManagedClusterPodIdentityProvisioningInfo. + + :ivar error: Pod identity assignment error (if any). + :vartype error: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, + } + + def __init__( + self, + *, + error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, + **kwargs + ): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPodIdentityProvisioningError + """ + super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) + self.error = error + + +class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to Azure. + + :ivar kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :vartype name: str + :ivar os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): + """ + :keyword kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :paramtype name: str + :keyword os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.name = name + self.os_type = os_type + self.upgrades = upgrades + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): + """Parameters to be applied to the cluster-autoscaler when enabled. + + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.Expander + :ivar max_empty_bulk_delete: The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str + """ + + _attribute_map = { + 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, + 'expander': {'key': 'expander', 'type': 'str'}, + 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, + 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, + 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, + 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, + 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, + 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, + 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, + 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, + 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, + 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, + 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, + 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, + 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, + 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, + 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, + } + + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + expander: Optional[Union[str, "Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + **kwargs + ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.Expander + :keyword max_empty_bulk_delete: The default is 10. + :paramtype max_empty_bulk_delete: str + :keyword max_graceful_termination_sec: The default is 600. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + self.expander = expander + self.max_empty_bulk_delete = max_empty_bulk_delete + self.max_graceful_termination_sec = max_graceful_termination_sec + self.max_node_provision_time = max_node_provision_time + self.max_total_unready_percentage = max_total_unready_percentage + self.new_pod_scale_up_delay = new_pod_scale_up_delay + self.ok_total_unready_count = ok_total_unready_count + self.scan_interval = scan_interval + self.scale_down_delay_after_add = scale_down_delay_after_add + self.scale_down_delay_after_delete = scale_down_delay_after_delete + self.scale_down_delay_after_failure = scale_down_delay_after_failure + self.scale_down_unneeded_time = scale_down_unneeded_time + self.scale_down_unready_time = scale_down_unready_time + self.scale_down_utilization_threshold = scale_down_utilization_threshold + self.skip_nodes_with_local_storage = skip_nodes_with_local_storage + self.skip_nodes_with_system_pods = skip_nodes_with_system_pods + + +class ManagedClusterSecurityProfile(msrest.serialization.Model): + """Security profile for the container service cluster. + + :ivar azure_defender: Azure Defender settings for the security profile. + :vartype azure_defender: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSecurityProfileAzureDefender + """ + + _attribute_map = { + 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, + } + + def __init__( + self, + *, + azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, + **kwargs + ): + """ + :keyword azure_defender: Azure Defender settings for the security profile. + :paramtype azure_defender: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSecurityProfileAzureDefender + """ + super(ManagedClusterSecurityProfile, self).__init__(**kwargs) + self.azure_defender = azure_defender + + +class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): + """Azure Defender settings for the security profile. + + :ivar enabled: Whether to enable Azure Defender. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + :vartype log_analytics_workspace_resource_id: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + **kwargs + ): + """ + :keyword enabled: Whether to enable Azure Defender. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + :paramtype log_analytics_workspace_resource_id: str + """ + super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) + self.enabled = enabled + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + + +class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure APIs. + + All required parameters must be populated in order to send to Azure. + + :ivar client_id: Required. The ID for the service principal. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str + """ + + _validation = { + 'client_id': {'required': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): + """ + :keyword client_id: Required. The ID for the service principal. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +class ManagedClusterSKU(msrest.serialization.Model): + """The SKU of a Managed Cluster. + + :ivar name: The name of a managed cluster SKU. Possible values include: "Basic". + :vartype name: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :vartype tier: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): + """ + :keyword name: The name of a managed cluster SKU. Possible values include: "Basic". + :paramtype name: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :paramtype tier: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterSKUTier + """ + super(ManagedClusterSKU, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class ManagedClusterUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only 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 ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :ivar control_plane_profile: Required. The list of available upgrade versions for the control + plane. + :vartype control_plane_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPoolUpgradeProfile + :ivar agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :vartype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'control_plane_profile': {'required': True}, + 'agent_pool_profiles': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, + } + + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): + """ + :keyword control_plane_profile: Required. The list of available upgrade versions for the + control plane. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPoolUpgradeProfile + :keyword agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterPoolUpgradeProfile] + """ + super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = control_plane_profile + self.agent_pool_profiles = agent_pool_profiles + + +class ManagedClusterWindowsProfile(msrest.serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to Azure. + + :ivar admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :vartype admin_password: str + :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :vartype license_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LicenseType + :ivar enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :vartype enable_csi_proxy: bool + :ivar gmsa_profile: The Windows gMSA Profile in the Managed Cluster. + :vartype gmsa_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WindowsGmsaProfile + """ + + _validation = { + 'admin_username': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, + 'gmsa_profile': {'key': 'gmsaProfile', 'type': 'WindowsGmsaProfile'}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "LicenseType"]] = None, + enable_csi_proxy: Optional[bool] = None, + gmsa_profile: Optional["WindowsGmsaProfile"] = None, + **kwargs + ): + """ + :keyword admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :paramtype license_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.LicenseType + :keyword enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :paramtype enable_csi_proxy: bool + :keyword gmsa_profile: The Windows gMSA Profile in the Managed Cluster. + :paramtype gmsa_profile: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.WindowsGmsaProfile + """ + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + self.enable_csi_proxy = enable_csi_proxy + self.gmsa_profile = gmsa_profile + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OperationListResult(msrest.serialization.Model): + """The List Operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of operations. + :vartype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OSOptionProfile(msrest.serialization.Model): + """The OS option profile. + + Variables are only 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 ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :ivar os_option_property_list: Required. The list of OS options. + :vartype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_option_property_list': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, + } + + def __init__( + self, + *, + os_option_property_list: List["OSOptionProperty"], + **kwargs + ): + """ + :keyword os_option_property_list: Required. The list of OS options. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProperty] + """ + super(OSOptionProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = os_option_property_list + + +class OSOptionProperty(msrest.serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to Azure. + + :ivar os_type: Required. The OS type. + :vartype os_type: str + :ivar enable_fips_image: Required. Whether the image is FIPS-enabled. + :vartype enable_fips_image: bool + """ + + _validation = { + 'os_type': {'required': True}, + 'enable_fips_image': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'os-type', 'type': 'str'}, + 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, + } + + def __init__( + self, + *, + os_type: str, + enable_fips_image: bool, + **kwargs + ): + """ + :keyword os_type: Required. The OS type. + :paramtype os_type: str + :keyword enable_fips_image: Required. Whether the image is FIPS-enabled. + :paramtype enable_fips_image: bool + """ + super(OSOptionProperty, self).__init__(**kwargs) + self.os_type = os_type + self.enable_fips_image = enable_fips_image + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.EndpointDependency] + """ + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only 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 value: Required. Collection of resources. + :vartype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.OutboundEnvironmentEndpoint] + """ + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PowerState(msrest.serialization.Model): + """Describes the Power State of the cluster. + + :ivar code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :vartype code: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.Code + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[Union[str, "Code"]] = None, + **kwargs + ): + """ + :keyword code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.Code + """ + super(PowerState, self).__init__(**kwargs) + self.code = code + + +class PrivateEndpoint(msrest.serialization.Model): + """Private endpoint which a connection belongs to. + + :ivar id: The resource ID of the private endpoint. + :vartype id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(msrest.serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", + "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionProvisioningState + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkServiceConnectionState + """ + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private endpoint connections. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection] + """ + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """A list of private link resources. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource] + """ + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The state of a private link service connection. + + :ivar status: The private link service connection status. Possible values include: "Pending", + "Approved", "Rejected", "Disconnected". + :vartype status: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword status: The private link service connection status. Possible values include: + "Pending", "Approved", "Rejected", "Disconnected". + :paramtype status: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + +class ResourceReference(msrest.serialization.Model): + """A reference to an Azure resource. + + :ivar id: The fully qualified Azure resource id. + :vartype id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +class RunCommandRequest(msrest.serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to Azure. + + :ivar command: Required. The command to run. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str + """ + + _validation = { + 'command': {'required': True}, + } + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'context': {'key': 'context', 'type': 'str'}, + 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, + } + + def __init__( + self, + *, + command: str, + context: Optional[str] = None, + cluster_token: Optional[str] = None, + **kwargs + ): + """ + :keyword command: Required. The command to run. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ + super(RunCommandRequest, self).__init__(**kwargs) + self.command = command + self.context = context + self.cluster_token = cluster_token + + +class RunCommandResult(msrest.serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'logs': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'logs': {'key': 'properties.logs', 'type': 'str'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(RunCommandResult, self).__init__(**kwargs) + self.id = None + self.provisioning_state = None + self.exit_code = None + self.started_at = None + self.finished_at = None + self.logs = None + self.reason = None + + +class Snapshot(Resource): + """A node pool snapshot 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. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar system_data: The system metadata relating to this snapshot. + :vartype system_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.SystemData + :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :ivar snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + "NodePool". Default value: "NodePool". + :vartype snapshot_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.SnapshotType + :ivar kubernetes_version: The version of Kubernetes. + :vartype kubernetes_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :vartype os_type: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSType + :ivar os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSSKU + :ivar vm_size: The size of the VM. + :vartype vm_size: str + :ivar enable_fips: Whether to use a FIPS-enabled OS. + :vartype enable_fips: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'kubernetes_version': {'readonly': True}, + 'node_image_version': {'readonly': True}, + 'os_type': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'vm_size': {'readonly': True}, + 'enable_fips': {'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}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, + 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, + 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["CreationData"] = None, + snapshot_type: Optional[Union[str, "SnapshotType"]] = "NodePool", + **kwargs + ): + """ + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :paramtype creation_data: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreationData + :keyword snapshot_type: The type of a snapshot. The default is NodePool. Possible values + include: "NodePool". Default value: "NodePool". + :paramtype snapshot_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.SnapshotType + """ + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.system_data = None + self.creation_data = creation_data + self.snapshot_type = snapshot_type + self.kubernetes_version = None + self.node_image_version = None + self.os_type = None + self.os_sku = None + self.vm_size = None + self.enable_fips = None + + +class SnapshotListResult(msrest.serialization.Model): + """The response from the List Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of snapshots. + :vartype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Snapshot"]] = None, + **kwargs + ): + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot] + """ + super(SnapshotListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SysctlConfig(msrest.serialization.Model): + """Sysctl settings for Linux agent nodes. + + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int + """ + + _attribute_map = { + 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, + 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, + 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, + 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, + 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, + 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, + 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, + 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, + 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, + 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, + 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, + 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, + 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, + 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, + 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, + 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, + 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, + 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, + 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, + 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, + 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, + 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, + 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, + 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, + } + + def __init__( + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + **kwargs + ): + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ + super(SysctlConfig, self).__init__(**kwargs) + self.net_core_somaxconn = net_core_somaxconn + self.net_core_netdev_max_backlog = net_core_netdev_max_backlog + self.net_core_rmem_default = net_core_rmem_default + self.net_core_rmem_max = net_core_rmem_max + self.net_core_wmem_default = net_core_wmem_default + self.net_core_wmem_max = net_core_wmem_max + self.net_core_optmem_max = net_core_optmem_max + self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog + self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets + self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout + self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time + self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes + self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl + self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse + self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range + self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 + self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 + self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 + self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max + self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets + self.fs_inotify_max_user_watches = fs_inotify_max_user_watches + self.fs_file_max = fs_file_max + self.fs_aio_max_nr = fs_aio_max_nr + self.fs_nr_open = fs_nr_open + self.kernel_threads_max = kernel_threads_max + self.vm_max_map_count = vm_max_map_count + self.vm_swappiness = vm_swappiness + self.vm_vfs_cache_pressure = vm_vfs_cache_pressure + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreatedByType + :ivar created_at: The UTC timestamp of resource creation. + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype 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 + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreatedByType + :keyword created_at: The UTC timestamp of resource creation. + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_11_01_preview.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ + 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 TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(TagsObject, self).__init__(**kwargs) + self.tags = tags + + +class TimeInWeek(msrest.serialization.Model): + """Time in a week. + + :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :vartype day: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.WeekDay + :ivar hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :vartype hour_slots: list[int] + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "WeekDay"]] = None, + hour_slots: Optional[List[int]] = None, + **kwargs + ): + """ + :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :paramtype day: str or ~azure.mgmt.containerservice.v2021_11_01_preview.models.WeekDay + :keyword hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :paramtype hour_slots: list[int] + """ + super(TimeInWeek, self).__init__(**kwargs) + self.day = day + self.hour_slots = hour_slots + + +class TimeSpan(msrest.serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + start: Optional[datetime.datetime] = None, + end: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ + super(TimeSpan, self).__init__(**kwargs) + self.start = start + self.end = end + + +class WindowsGmsaProfile(msrest.serialization.Model): + """Windows gMSA Profile in the managed cluster. + + :ivar enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it to + empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :vartype dns_server: str + :ivar root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :vartype root_domain_name: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'dns_server': {'key': 'dnsServer', 'type': 'str'}, + 'root_domain_name': {'key': 'rootDomainName', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + dns_server: Optional[str] = None, + root_domain_name: Optional[str] = None, + **kwargs + ): + """ + :keyword enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :paramtype enabled: bool + :keyword dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it + to empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :paramtype dns_server: str + :keyword root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :paramtype root_domain_name: str + """ + super(WindowsGmsaProfile, self).__init__(**kwargs) + self.enabled = enabled + self.dns_server = dns_server + self.root_domain_name = root_domain_name diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/__init__.py new file mode 100644 index 000000000000..5e1e5e72fa59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'MaintenanceConfigurationsOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', + 'SnapshotsOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..7340f8071633 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py @@ -0,0 +1,914 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +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 HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_available_agent_pool_versions_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_upgrade_node_image_version_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class AgentPoolsOperations(object): + """AgentPoolsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.AgentPoolListResult"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'AgentPool') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.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( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('AgentPool', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + @distributed_trace + def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('AgentPoolUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + + @distributed_trace + def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolAvailableVersions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_available_agent_pool_versions_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_available_agent_pool_versions.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('AgentPoolAvailableVersions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + + + def _upgrade_node_image_version_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_upgrade_node_image_version_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + template_url=self._upgrade_node_image_version_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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 + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + + @distributed_trace + def begin_upgrade_node_image_version( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> LROPoller["_models.AgentPool"]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + deserialized = self._deserialize('AgentPool', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..eceb1f1ec8d6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py @@ -0,0 +1,457 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_managed_cluster_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "configName": _SERIALIZER.url("config_name", config_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class MaintenanceConfigurationsOperations(object): + """MaintenanceConfigurationsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list_by_managed_cluster( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationListResult"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_by_managed_cluster.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_managed_cluster_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :param parameters: The maintenance configuration to create or update. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + + @distributed_trace + def delete( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..fda1d1828bf6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py @@ -0,0 +1,2461 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +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 HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_os_options_request( + subscription_id: str, + location: str, + *, + resource_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = _SERIALIZER.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_upgrade_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_access_profile_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "roleName": _SERIALIZER.url("role_name", role_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_admin_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_cluster_monitoring_user_credentials_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = _SERIALIZER.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_service_principal_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reset_aad_profile_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_rotate_cluster_certificates_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_start_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_command_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_command_result_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "commandId": _SERIALIZER.url("command_id", command_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ManagedClustersOperations(object): + """ManagedClustersOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def get_os_options( + self, + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OSOptionProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_os_options_request( + subscription_id=self._config.subscription_id, + location=location, + resource_type=resource_type, + template_url=self.get_os_options.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('OSOptionProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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.ContainerService/managedClusters'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.ManagedClusterListResult"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :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 ManagedClusterListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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.ContainerService/managedClusters'} # type: ignore + + @distributed_trace + def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_upgrade_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get_upgrade_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedClusterUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + + @distributed_trace + def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": + """Gets an access profile of a managed cluster. + + **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. + :type role_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAccessProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterAccessProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_access_profile_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + template_url=self.get_access_profile.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedClusterAccessProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + + @distributed_trace + def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_cluster_admin_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_admin_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + + @distributed_trace + def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the user credentials of a managed cluster. + + Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_cluster_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + + @distributed_trace + def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_cluster_monitoring_user_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + server_fqdn=server_fqdn, + template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + + @distributed_trace + def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": + """Gets a managed cluster. + + Gets a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedCluster') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The managed cluster to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.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( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._update_tags_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> LROPoller["_models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.ContainerService/managedClusters/{resourceName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed cluster. + + Deletes a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _reset_service_principal_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + + request = build_reset_service_principal_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_service_principal_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + + @distributed_trace + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterServicePrincipalProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.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._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + def _reset_aad_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + + request = build_reset_aad_profile_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._reset_aad_profile_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + + @distributed_trace + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD Profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAADProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.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._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + def _rotate_cluster_certificates_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_rotate_cluster_certificates_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._rotate_cluster_certificates_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + + @distributed_trace + def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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, azure.core.polling.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._rotate_cluster_certificates_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def _stop_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_stop_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._stop_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + + @distributed_trace + def begin_stop( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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, azure.core.polling.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._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + def _start_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_start_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self._start_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + + @distributed_trace + def begin_start( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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, azure.core.polling.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._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(request_payload, 'RunCommandRequest') + + request = build_run_command_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self._run_command_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + + @distributed_trace + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> LROPoller["_models.RunCommandResult"]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param request_payload: The run command request. + :type request_payload: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] + lro_delay = kwargs.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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('RunCommandResult', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **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_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + @distributed_trace + def get_command_result( + self, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param command_id: Id of the command. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_command_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + template_url=self.get_command_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + + @distributed_trace + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_outbound_network_dependencies_endpoints_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py new file mode 100644 index 000000000000..e176a26ac4dc --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ContainerService/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..54c686520843 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + + @distributed_trace + def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. + :type parameters: + ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in 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, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **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.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..cf1d5bd938c9 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,136 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..925527acb7d1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_post_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class ResolvePrivateLinkServiceIdOperations(object): + """ResolvePrivateLinkServiceIdOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PrivateLinkResource') + + request = build_post_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.post.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py new file mode 100644 index 000000000000..091fab16e42c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py @@ -0,0 +1,636 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', min_length=1), + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class SnapshotsOperations(object): + """SnapshotsOperations 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.containerservice.v2021_11_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 + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: + """Gets a list of snapshots in the specified subscription. + + Gets a list of snapshots in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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.ContainerService/snapshots'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.SnapshotListResult"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :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 SnapshotListResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_11_01_preview.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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.ContainerService/snapshots'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": + """Gets a snapshot. + + Gets a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The snapshot to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Snapshot') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_11_01_preview.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + + @distributed_trace + def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + resource_name=resource_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file